/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;800&display=swap');

/* ============================================= */
/* == Global Variables & Base Styles =========== */
/* ============================================= */

:root {
  /* Color Palette */
  --primary: #006C7F;
  --primary-hover: #0e7490;
  --text-dark: #1f2937;
  --text-medium: #006C7F;
  --text-light: #6b7280;
  --border: #e5e7eb;
  --bg-light: #f8fafc;
  --bg-white: #ffffff;
  
  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
  
  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 40px;
  
  /* Typography */
  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 16px;
  --text-lg: 18px;
  --text-xl: 20px;
  --text-2xl: 22px;
  
  /* Borders */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition: all 0.2s ease-out;
}

/* Force Montserrat font family on all elements */
.cdm-articles-container,
.cdm-articles-container *,
.cdm-articles-search-input,
.cdm-articles-filter-select,
.cdm-article-card,
.cdm-featured-articles-container,
.cdm-featured-articles-container * {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}

/* Base Container */
.cdm-articles-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0;
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-dark);
}

/* ============================================= */
/* == Search & Filter Controls ================ */
/* ============================================= */

/* Page-specific overrides with high specificity */
.cdm-articles-container .cdm-articles-controls select,
.cdm-articles-container .cdm-articles-filter select,
.cdm-articles-container .cdm-custom-dropdown-selected {
  padding:20px 0 20px 20px !important;
  border-radius: 30px !important;
  height: 55px !important;
  box-sizing: border-box !important;
}

.cdm-articles-container .cdm-articles-controls input[type="text"],
.cdm-articles-container .cdm-articles-controls input[type="search"],
.cdm-articles-container .cdm-articles-search input[type="search"],
.cdm-articles-container .cdm-articles-search-input {
  height: 55px !important;
  border-radius: 30px !important;
  padding: 20px 0 20px 20px !important;
  box-sizing: border-box !important;
}

/* Adjust padding-right for search input to accommodate button */
.cdm-articles-container .cdm-articles-search-input {
  padding-right: 60px !important;
}

/* Adjust padding-right for custom dropdown to accommodate arrow */
.cdm-articles-container .cdm-custom-dropdown-selected {
  padding-right: 26px !important;
}

.cdm-articles-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 48px;
  gap: 24px;
  flex-wrap: wrap;
  max-width: 1440px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 0px;
}

/* Search Box - Modern Clean Style */
.cdm-articles-search {
  flex: 1;
  max-width: 50%;
}

.cdm-articles-search-form {
  position: relative;
  display: flex;
  align-items: center;
}

.cdm-articles-search-input {
  width: 100%;
  padding: 20px 24px;
  padding-right: 70px;
  border: 1px solid #0e7490;
  border-radius: 30px;
  font-size: 15px;
  color: #333;
  background: #fff;
  transition: all 0.2s ease;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  font-family: 'Montserrat', sans-serif !important;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  height: 70px;
  box-sizing: border-box;
}

.cdm-articles-search-input:focus {
  outline: none;
  border-color: #0e7490;
  box-shadow: 0 0 0 3px rgba(8,145,178,0.1);
}

.cdm-articles-search-input::placeholder {
  color: #999;
  font-weight: 400;
  font-family: 'Montserrat', sans-serif !important;
}

.cdm-articles-search-submit {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: #0e7490;
  border: none;
  padding: 14px;
  cursor: pointer;
  color: white;
  border-radius: 30px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(8, 145, 178, 0.2);
}

.cdm-articles-search-submit:hover {
  background: #0e7490;
  transform: translateY(-50%) scale(1.05);
  box-shadow: 0 4px 8px rgba(8, 145, 178, 0.3);
}

.cdm-articles-search-submit:active {
  transform: translateY(-50%) scale(0.98);
}

.cdm-articles-search-submit svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.5;
}

/* Filter Dropdown - Custom Dropdown Solution */
.cdm-articles-filter {
  min-width: 300px;
  max-width: 50%;
  flex: 1;
}

.cdm-articles-filter-form {
  position: relative;
}

.cdm-articles-filter-label {
  display: none;
}

/* Hide the real select */
.cdm-articles-filter-select-hidden {
  display: none !important;
}

/* Custom Dropdown Container */
.cdm-custom-dropdown {
  position: relative;
  width: 100%;
}

/* Custom Dropdown Selected Area */
.cdm-custom-dropdown-selected {
  width: 100%;
  padding: 16px 20px;
  padding-right: 50px;
  border: 2px solid #e5e7eb;
  border-radius: 30px !important ;
  font-size: 16px;
/*   background: #f8fafc; */
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  font-family: 'Montserrat', sans-serif;
  font-weight: 400;
  color: #999;
  font-style: normal !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  position: relative;
  height: 70px;
  box-sizing: border-box;
}

.cdm-custom-dropdown-selected:hover {
  border-color: #006C7F;
  background: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99,102,241,0.1);
}

.cdm-custom-dropdown-selected.active {
  border-color: #006C7F;
  background: #fff;
  box-shadow: 0 4px 16px rgba(99,102,241,0.15);
  transform: translateY(-1px);
}

/* Selected text */
.cdm-dropdown-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* When option is selected */
.cdm-custom-dropdown-selected.has-selection .cdm-dropdown-text {
  color: #374151;
  font-style: normal;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Dropdown Arrow */
.cdm-dropdown-arrow {
  width: 20px;
  height: 20px;
  color: #64748b;
  transition: all 0.3s ease;
  flex-shrink: 0;
  margin-left: 8px;
  stroke-width: 2.5;
}

.cdm-custom-dropdown-selected:hover .cdm-dropdown-arrow {
  color: #374151;
}

.cdm-custom-dropdown-selected.active .cdm-dropdown-arrow {
  transform: rotate(180deg);
  color: #374151;
}

/* Dropdown Options Container */
.cdm-custom-dropdown-options {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #fff;
  border: 2px solid #006C7F;
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(99,102,241,0.2);
  margin-top: 4px;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 300px;
  overflow-y: auto;
}

.cdm-custom-dropdown-options.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Individual Option */
.cdm-dropdown-option {
  padding: 12px 20px;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 1px solid #f1f5f9;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.cdm-dropdown-option:last-child {
  border-bottom: none;
}

.cdm-dropdown-option:hover {
  background: #f8fafc;
  color: #006C7F;
  padding-left: 24px;
}

.cdm-dropdown-option:first-child {
  color: #94a3b8;
  font-style: normal;
  text-transform: none;
  font-weight: 400;
}

.cdm-dropdown-option:first-child:hover {
  background: #f8fafc;
  color: #94a3b8;
}

.cdm-dropdown-option.selected {
  background: #006C7F;
  color: #fff;
  font-weight: 600;
}

.cdm-dropdown-option.selected:hover {
  background: #5855eb;
  color: #fff;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
  .cdm-articles-controls {
    gap: 20px;
    max-width: 100%;
  }
  
  .cdm-articles-search,
  .cdm-articles-filter {
    min-width: 280px;
    max-width: 350px;
  }
}

@media (max-width: 768px) {
  .cdm-articles-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 0 16px;
    margin-bottom: 32px;
  }
  
  .cdm-articles-search,
  .cdm-articles-filter {
    min-width: 100%;
    max-width: 100%;
  }
  
  .cdm-articles-search-input {
    padding: 14px 20px;
    padding-right: 55px;
    font-size: 14px;
  }
  
  .cdm-custom-dropdown-selected {
    padding: 14px 20px;
    padding-right: 45px;
    font-size: 14px;
  }
  
  .cdm-dropdown-option {
    padding: 10px 16px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .cdm-articles-controls {
    padding: 0 12px;
    gap: 12px;
  }
  
  .cdm-articles-search-input {
    padding: 12px 16px;
    padding-right: 50px;
    font-size: 14px;
  }
  
  .cdm-custom-dropdown-selected {
    padding: 12px 16px;
    padding-right: 40px;
    font-size: 14px;
  }
  
  .cdm-dropdown-arrow {
    width: 14px;
    height: 14px;
  }
  
  .cdm-articles-search-submit {
    padding: 12px;
    right: 8px;
    border-radius:30px;
  }
  
  .cdm-articles-search-submit svg {
    width: 14px;
    height: 14px;
  }
}

/* Animation for focus states */
@keyframes inputFocus {
  from { box-shadow: 0 0 0 0 rgba(8,145,178,0.1); }
  to { box-shadow: 0 0 0 3px rgba(8,145,178,0.1); }
}

.cdm-articles-search-input:focus,
.cdm-articles-filter-select:focus {
  animation: inputFocus 0.2s ease-out;
}

/* ============================================= */
/* == Articles Grid =========================== */
/* ============================================= */

.cdm-articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 32px;
  margin: 0;
}

.cdm-article-card {
  background: var(--bg-white);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  opacity: 1;
  transform: translateY(0);
}

.cdm-article-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.cdm-article-card__link {
  display: block;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

/* Card Image */
.cdm-article-card__image {
  position: relative;
  padding-top: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.cdm-article-card__image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.cdm-article-card:hover .cdm-article-card__image img {
  transform: scale(1.03);
}

/* Card Content */
.cdm-article-card__content {
  padding: 28px;
  position: relative;
}

.cdm-article-card__date {
  display: block;
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 12px;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.cdm-article-card__title {
  margin: 0 0 16px;
  font-size: 16px;
  line-height: 1.4;
  font-weight: 700;
  color: var(--text-dark);
  transition: color 0.2s ease;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cdm-article-card:hover .cdm-article-card__title {
  color: var(--primary);
}

/* Updated excerpt styling - cleaner appearance */
.cdm-article-card__excerpt {
  margin: 0 0 20px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-medium);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-align: left;
  hyphens: auto;
}

/* Hide excerpt when it contains unwanted content */
.cdm-article-card__excerpt:empty,
.cdm-article-card__excerpt:has-text("Table of Contents"),
.cdm-article-card__excerpt:has-text("Heading") {
  display: none;
}

/* Card Tags */
.cdm-article-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.cdm-article-card__tag {
  display: inline-block;
  padding: 6px 14px;
  background: #f1f5f9;
  color: var(--text-medium);
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.cdm-article-card__tag:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: translateY(-1px);
}

/* Category and Tag Styling */
.cdm-article-card__category {
  background: var(--primary) !important;
  color: white !important;
  font-weight: 800;
  border-color: var(--primary) !important;
}

.cdm-article-card__category:hover {
  background: var(--primary-hover) !important;
  border-color: var(--primary-hover) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(8, 145, 178, 0.25);
}

.cdm-article-card__tag-secondary {
  background: var(--bg-light);
  color: var(--text-medium);
  border: 1px solid var(--border);
}

.cdm-article-card__tag-secondary:hover {
  background: var(--text-medium);
  color: white;
  border-color: var(--text-medium);
  transform: translateY(-1px);
}

/* ============================================= */
/* == Loading & States ======================== */
/* ============================================= */

.cdm-articles-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
}

.cdm-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(8, 145, 178, 0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.cdm-no-results {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--text-light);
  grid-column: 1 / -1;
}

.cdm-no-results h3 {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
  font-weight: 600;
  margin-bottom: 8px;
}

.cdm-no-results p {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}

/* ============================================= */
/* == Pagination ============================== */
/* ============================================= */

.cdm-pagination-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
  margin-bottom: 0rem;
}

.cdm-pagination {
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  -ms-flex-pack: center;
  justify-content: center;
  padding:0;
  margin: 0 auto;
  font-family: 'Montserrat', sans-serif !important;
}

.cdm-pagination-prev,
.cdm-pagination-next {
  position: relative;
  font-size: 0 !important;
  height: 100%;
  width: 3rem;
  height: 3rem;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.cdm-pagination-prev::after,
.cdm-pagination-next::after {
  content: '';
  position: absolute;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23006C7F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='9 18 15 12 9 6'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  -webkit-background-size: contain;
  background-size: contain;
  background-position: center;
  width: 2rem;
  height: 2.5rem;
  top: 50%;
  left: 50%;
  -webkit-transform: translate(-50%, -50%);
  -ms-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
  transition: all 0.3s ease;
}

.cdm-pagination-prev::after {
  -webkit-transform: translate(-50%, -50%) rotate(-180deg);
  -ms-transform: translate(-50%, -50%) rotate(-180deg);
  transform: translate(-50%, -50%) rotate(-180deg);
}

.cdm-pagination-prev:hover::after,
.cdm-pagination-next:hover::after {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23004a56' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='9 18 15 12 9 6'%3e%3c/polyline%3e%3c/svg%3e");
  transform: translate(-50%, -50%) scale(1.1);
}

.cdm-pagination-prev:hover::after {
  -webkit-transform: translate(-50%, -50%) rotate(-180deg) scale(1.1);
  -ms-transform: translate(-50%, -50%) rotate(-180deg) scale(1.1);
  transform: translate(-50%, -50%) rotate(-180deg) scale(1.1);
}

.cdm-pagination-number {
  background: transparent;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 2.6rem;
  line-height: 1.2;
  letter-spacing: 0.14em;
  color: #9ca3af;
  margin: 0.5rem;
  font-family: 'Montserrat', sans-serif !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
  min-width: auto;
  height: auto;
}

.cdm-pagination-number:hover {
  color: #006C7F;
  transform: translateY(-2px);
}

.cdm-pagination-number.cdm-pagination-active {
  color: #006C7F;
}

.cdm-pagination-dots {
  display: flex;
  align-items: center;
  padding: 0 8px;
  color: #9ca3af;
  font-weight: 600;
  font-size: 3.6rem;
  line-height: 1.2;
  letter-spacing: 0.14em;
  font-family: 'Montserrat', sans-serif !important;
  user-select: none;
}

/* Loading state for pagination */
.cdm-pagination-btn.cdm-loading {
  pointer-events: none;
  opacity: 0.6;
}

.cdm-pagination-btn.cdm-loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ============================================= */
/* == Responsive Adjustments ================== */
/* ============================================= */

@media (max-width: 768px) {
  .cdm-articles-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 0;
    margin-bottom: 32px;
  }
  
  .cdm-articles-search,
  .cdm-articles-filter {
    min-width: 100%;
    max-width: 100%;
  }
  
  /* Pagination responsive styles */
  .cdm-pagination-wrapper {
    margin-top: 2rem;
    margin-bottom: 1.5rem;
  }
  
  .cdm-pagination {
    padding: 2rem 0;
  }
  
  .cdm-pagination-number {
    font-size: 2.4rem;
    margin: 0.3rem;
  }
  
  .cdm-pagination-dots {
    font-size: 2.4rem;
  }
  
  .cdm-pagination-prev,
  .cdm-pagination-next {
    width: 2.5rem;
    height: 2.5rem;
  }
  
  .cdm-pagination-prev::after,
  .cdm-pagination-next::after {
    width: 0.8rem;
    height: 2rem;
  }
  
  .cdm-articles-search-input,
  .cdm-articles-filter-select {
    padding: 14px 20px;
  }
  
  .cdm-articles-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  
  .cdm-article-card__content {
    padding: 20px;
  }
  
  .cdm-article-card__title {
    font-size: 14px;
    margin-bottom: 12px;
  }
  
  .cdm-article-card__excerpt {
    font-size: 14px;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }
}

@media (max-width: 480px) {
  .cdm-articles-container {
    padding: 0;
  }
  
  .cdm-articles-search-input,
  .cdm-articles-filter-select {
    padding: 12px 16px;
  }
  
  .cdm-article-card__content {
    padding: 16px;
  }
  
  .cdm-article-card__title {
    font-size: 14px;
    margin-bottom: 8px;
  }
  
  .cdm-article-card__date {
    font-size: 12px;
    margin-bottom: 8px;
  }
  
  /* Mobile pagination styles */
  .cdm-pagination-wrapper {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
  }
  
  .cdm-pagination {
    padding: 1.5rem 0;
    overflow-x: auto;
    margin: 0 -8px;
  }
  
  .cdm-pagination-number {
    font-size: 1.8rem;
    margin: 0.2rem;
    flex-shrink: 0;
  }
  
  .cdm-pagination-dots {
    font-size: 1.8rem;
    padding: 0 4px;
  }
  
  .cdm-pagination-prev,
  .cdm-pagination-next {
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
  }
  
  .cdm-pagination-prev::after,
  .cdm-pagination-next::after {
    width: 1.6rem;
    height: 1.5rem;
  }
}

/* ============================================= */
/* == Featured Articles Pills ================= */
/* ============================================= */

.cdm-featured-articles-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 0;
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}

.cdm-featured-articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%;
}

.cdm-featured-article-card {
  border-radius: 25px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: 270px;
}

.cdm-featured-article-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.cdm-featured-article-card__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: inherit;
  height: 100%;
  width: 100%;
}

.cdm-featured-article-card__image {
  width: 100%;
  height: 160px;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  margin-bottom: 16px;
  position: relative;
}

.cdm-featured-article-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 20px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.cdm-featured-article-card:hover .cdm-featured-article-card__image img {
  transform: scale(1.02);
}

.cdm-featured-article-card__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  flex: 1;
  width: 100%;
}

.cdm-featured-article-card__badge {
  background: none;
  color:#006C7F;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  border: 1px solid #8C909A;
  transition: all 0.2s ease;
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}

.cdm-featured-article-card:hover .cdm-featured-article-card__badge {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.cdm-featured-article-card__title {
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
  font-weight: 600;
  color: #192236;
  transition: color 0.2s ease;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-align: center;
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}

.cdm-featured-article-card:hover .cdm-featured-article-card__title {
  color: var(--primary);
}

/* Responsive Design for Pills */
@media (max-width: 1024px) {
  .cdm-featured-articles-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  
  .cdm-featured-articles-container {
    padding: 1.5rem 1rem;
  }
  
  .cdm-featured-article-card {
    min-height: 300px;
    padding: 18px;
  }
  
  .cdm-featured-article-card__image {
    height: 140px;
  }
}

@media (max-width: 768px) {
  .cdm-featured-articles-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .cdm-featured-articles-container {
    padding: 1rem 0.75rem;
  }
  
  .cdm-featured-article-card {
    min-height: 280px;
    padding: 16px;
  }
  
  .cdm-featured-article-card__image {
    height: 120px;
    margin-bottom: 12px;
  }
  
  .cdm-featured-article-card__title {
    font-size: 15px;
  }
  
  .cdm-featured-article-card__badge {
    font-size: 10px;
    padding: 6px 12px;
  }
}

@media (max-width: 480px) {
  .cdm-featured-articles-container {
    padding: 0.75rem 0.5rem;
  }
  
  .cdm-featured-article-card {
    min-height: 260px;
    padding: 14px;
  }
  
  .cdm-featured-article-card__image {
    height: 100px;
    margin-bottom: 10px;
  }
  
  .cdm-featured-article-card__title {
    font-size: 14px;
    line-height: 1.3;
  }
  
  .cdm-featured-article-card__badge {
    font-size: 9px;
    padding: 5px 10px;
  }
}

/* End of CSS */

/* ============================================= */
/* == Infographics Download Enhancement ======= */
/* ============================================= */

/* Enhanced download link styling */
.cdm-download-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: white !important;
  text-decoration: none !important;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  font-family: 'Montserrat', sans-serif !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
  cursor: pointer;
  letter-spacing: 0.3px;
}

.cdm-download-link:hover {
  background: linear-gradient(135deg, #2980b9, #1f618d);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(52, 152, 219, 0.4);
  color: white !important;
  text-decoration: none !important;
}

.cdm-download-link:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

/* PDF download specific styling */
.cdm-download-pdf {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

.cdm-download-pdf:hover {
  background: linear-gradient(135deg, #c0392b, #a93226);
  box-shadow: 0 4px 16px rgba(231, 76, 60, 0.4);
}

/* Image download specific styling */
.cdm-download-image,
.cdm-download-featured-image {
/*   background: linear-gradient(135deg, #27ae60, #229954);
  box-shadow: 0 2px 8px rgba(39, 174, 96, 0.3); */
}

.cdm-download-image:hover,
.cdm-download-featured-image:hover {
/*   background: linear-gradient(135deg, #229954, #1e8449);
  box-shadow: 0 4px 16px rgba(39, 174, 96, 0.4); */
}

/* Download icon animation */
.cdm-download-link svg {
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.cdm-download-link:hover svg {
  transform: translateY(1px);
}

/* Loading state for downloads */
.cdm-download-link.downloading {
  pointer-events: none;
  opacity: 0.7;
}

.cdm-download-link.downloading svg {
  animation: downloadPulse 1.5s ease-in-out infinite;
}

@keyframes downloadPulse {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(2px); opacity: 0.7; }
}

/* Ensure download links are visible and properly positioned */
.cdm-pill-actions {
  display: flex;
  align-items: center;
/*   justify-content: flex-start; */
  margin-top: 12px;
  gap: 8px;
}

/* Responsive adjustments for download buttons */
@media (max-width: 768px) {
  .cdm-download-link {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 16px;
  }
  
  .cdm-download-link svg {
    width: 14px;
    height: 14px;
  }
}

@media (max-width: 480px) {
  .cdm-pill-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  
  .cdm-download-link {
    justify-content: center;
    padding: 8px 12px;
    width: 100%;
    box-sizing: border-box;
  }
}
