/**
 * Campaign Card Component - Article Teaser
 * Card-style display for articles with progress tracking
 */

/* Campaign Card Container */
.campaign-card {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  height: 100%;
  position: relative;
}

.campaign-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* Make entire card clickable */
.campaign-card > a.card-link-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Card Image */
.campaign-card-image {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  overflow: hidden;
  background: #f5f5f5;
}

.campaign-card-image .field,
.campaign-card-image .media {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.campaign-card-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Placeholder for missing images - Blue background with colored logo */
.campaign-image-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #005D92;
}

.campaign-image-placeholder .placeholder-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  height: 100px;
  width: auto;
  max-width: 80%;
  max-height: 80%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

/* Hover: Zoom the logo instead of moving it */
.campaign-card:hover .campaign-image-placeholder .placeholder-logo {
  transform: translate(-50%, -50%) scale(1.1);
}

/* Progress Bar Section - Minimalist Design */
.campaign-progress-bar {
  padding: 0;
  background: #fff;
}

/* Progress Bar Track */
.progress-bar-track {
  width: 100%;
  height: 4px;
  background: #e9ecef;
  border-radius: 0;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #0056A0 0%, #667eea 100%);
  width: 0;
  transition: width 0.3s ease;
  position: relative;
}

/* Hover Animation - Progress bar grows from 0 to 100% */
.campaign-card:hover .progress-bar-fill {
  width: 100% !important;
  transition: width 2s ease-in-out;
}

/* Card Content */
.campaign-content {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

/* Meta Information - at bottom of card, more compact */
.campaign-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid #e9ecef;
  font-size: 0.8125rem;
  color: #6c757d;
}

.campaign-author,
.campaign-date {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.campaign-meta svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.campaign-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.4;
  margin: 0 0 0.5rem 0;
  color: #2c3e50;
}

.campaign-card:hover .campaign-title {
  color: #0056A0;
}

.campaign-body {
  font-size: 15px !important;
  line-height: 1.6 !important;
  color: #6c757d;
  margin: 0;
  padding: 0;
  max-height: calc(1.6 * 15px * 4); /* Exactly 4 lines */
}

/* Apply ellipsis to the field wrapper */
.campaign-body .field,
.campaign-body .field__item,
.campaign-body .field--name-field-teaser-text,
.campaign-body .field--name-body {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 15px !important;
  line-height: 1.6 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* All text elements inside should inherit styling */
.campaign-body *,
.campaign-body p,
.campaign-body span,
.campaign-body div {
  font-size: 15px !important;
  line-height: 1.6 !important;
  margin: 0 !important;
  padding: 0 !important;
}

.campaign-body p {
  display: inline;
}


/* Responsive adjustments */
@media (max-width: 767px) {
  .campaign-content {
    padding: 1.25rem;
  }
  
  .campaign-meta {
    font-size: 0.8rem;
    gap: 0.75rem;
    flex-wrap: wrap;
  }
  
  .campaign-title {
    font-size: 1.1rem;
  }
  
  .campaign-body {
    font-size: 0.9rem;
  }
}

/* Print styles */
@media print {
  .campaign-card {
    box-shadow: none;
    border: 1px solid #ddd;
    page-break-inside: avoid;
  }
  
  .campaign-card:hover {
    transform: none;
  }
  
  .progress-bar-fill {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}

/* Accessibility */
.campaign-card:focus-within {
  outline: 2px solid #0056A0;
  outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  .campaign-title a,
  .progress-bar-fill {
    transition: none;
    animation: none;
  }
}