/* AMRC News Cards - Responsive Grid Layout with Fixed Heights */

/* Grid Container */
.amrc-news-grid {
  display: grid;
  gap: 24px;
  width: 100%;
  /* max-width: 1200px; */
  margin: 0 auto;
  padding: 0 16px;
}

/* Desktop (≥1024px): 3 cards per row */
@media (min-width: 1024px) {
  .amrc-news-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Tablet (641-1023px): 2 cards per row */
@media (min-width: 641px) and (max-width: 1023px) {
  .amrc-news-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile (≤640px): 1 card per row */
@media (max-width: 640px) {
  .amrc-news-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 0 12px;
  }
}

/* Card Component - Fixed Height 268px */
.amrc-card {
  width: 100%;
  height: 268px;
  border-radius: 7px;
  box-shadow: 0 0 11px rgba(0,0,0,0.15);
  overflow: hidden;
  position: relative;
}

.amrc-card__content {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 7px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Gradient Overlay */
.amrc-card__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  /* background: linear-gradient(180deg, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.8) 100%); */
  border-radius: 7px;
  z-index: 1;
}

/* Top Section - Accent Bar + Title */
.amrc-card__top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  padding: 24px 24px 0 0px;
}


.amrc-card__accent {
    width: 6px;
    min-width: 6px;
    height: 22px;
    background: #A1D8E6;
    border-radius: 0px;
    margin-right: 12px;
    flex-shrink: 0;
}

.amrc-card__title {
  font-family: 'Lato', Arial, sans-serif;
  font-weight: 900;
  font-size: 16px;
  line-height: 19px;
  text-transform: uppercase;
  color: #fff;
  margin: 0;
  letter-spacing: 0.5px;
}

/* Bottom Section - Icon + Link */
.amrc-card__bottom {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px 24px 24px;
}

.amrc-card__icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.amrc-card__link {
  font-family: 'Lato', Arial, sans-serif;
  font-weight: 900;
  font-size: 16px;
  line-height: 19px;
  color: #fff;
  text-decoration: underline;
  word-break: break-word;
  
  /* 3-line clamp with ellipsis */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: calc(19px * 3);
  margin: 0;
  transition: opacity 0.2s ease;
}

.amrc-card__link:hover {
  opacity: 0.8;
  color: #fff;
}

.amrc-card__link:focus {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Mobile Optimizations */
@media (max-width: 640px) {
  .amrc-card__top {
    padding: 16px 16px 0 0px;
  }
  
  .amrc-card__title {
    font-size: 14px;
    line-height: 17px;
  }
  
  .amrc-card__bottom {
    padding: 12px 16px 16px 16px;
    gap: 12px;
  }
  
  .amrc-card__icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
  }
  
  .amrc-card__link {
    font-size: 14px;
    line-height: 17px;
    max-height: calc(17px * 3);
  }
}

/* AMRC Search Component - Figma Design */
.amrc-search-container {
  width: 100%;
  max-width: 600px;
  margin: 0 auto 30px auto;
}

.amrc-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 337px;
  margin: 0 auto;
}

.amrc-search-input {
  box-sizing: border-box;
  width: 100%;
  height: 40px;
  background: #FFFFFF;
  border: 1px solid #0075BE;
  border-radius: 30px;
  padding: 10px 50px 10px 20px;
  font-family: 'Lato', Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #333;
  outline: none;
  transition: all 0.3s ease;
}

.amrc-search-input:focus {
  border-color: #0075BE;
  box-shadow: 0 0 0 3px rgba(0, 117, 190, 0.1);
}

.amrc-search-input::placeholder {
  color: #999;
  font-style: italic;
}

.amrc-search-btn {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

.amrc-search-btn:hover {
  background-color: rgba(0, 117, 190, 0.1);
}

.amrc-search-btn:focus {
  outline: 2px solid #0075BE;
  outline-offset: 2px;
}

.amrc-search-loading {
  position: absolute;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
}

.amrc-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #0075BE;
  border-radius: 50%;
  animation: amrc-spin 1s linear infinite;
}

@keyframes amrc-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.amrc-search-results {
  margin-top: 20px;
}

.amrc-search-no-results,
.amrc-search-error {
  text-align: center;
  padding: 40px 20px;
  color: #666;
  font-style: italic;
}

.amrc-search-no-results p,
.amrc-search-error p {
  margin: 0;
  font-size: 16px;
}

/* Mobile responsive for search */
@media (max-width: 640px) {
  .amrc-search-wrapper {
    max-width: 100%;
  }
  
  .amrc-search-input {
    font-size: 16px; /* Prevent zoom on iOS */
    height: 44px;
    padding: 12px 50px 12px 16px;
  }
  
  .amrc-search-btn {
    width: 34px;
    height: 34px;
    right: 5px;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .amrc-search-wrapper {
    max-width: 300px;
  }
}
