/* News Card Styles */
.news-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 16px;
  overflow: hidden;
  background: var(--an-bg-tertiary, #ffffff);
  border: 1px solid var(--an-border-light, #e2e8f0);
  height: 320px;
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
  position: relative;
}

.news-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    transparent 0%,
    rgba(8, 206, 123, 0.02) 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 1;
}

.news-card:hover::before {
  opacity: 1;
}

/* Subtle focus outline for accessibility */
.news-card:focus-within,
.news-card:focus {
  outline: 3px solid rgba(14, 165, 233, 0.12);
  outline-offset: 2px;
  box-shadow: none;
}

.news-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(16, 24, 40, 0.15),
    0 4px 12px rgba(8, 206, 123, 0.1);
  border-color: rgba(8, 206, 123, 0.2);
}

.news-card .news-img-wrapper {
  position: relative;
  overflow: hidden;
  background: var(--an-bg-secondary, #f8f9fa);
  height: 220px;
  display: block;
}

.news-card .news-img-wrapper img {
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.35s ease;
  object-fit: cover;
  width: 100%;
  height: 100%;
  display: block;
  min-height: 200px;
  transform-origin: center center;
  filter: saturate(0.98);
}

.news-card:hover .news-img-wrapper img {
  transform: scale(1.06);
  filter: saturate(1.05) contrast(1.02);
}

.news-card .card-body {
  background: transparent;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.news-card h6 {
  color: var(--an-text-primary, #1e293b);
  font-size: 1.05rem;
  line-height: 1.4;
  margin: 0;
  transition: color 0.18s ease, transform 0.18s ease;
}

.news-card:hover h6 {
  color: var(--an-text-accent, #0ea5e9);
  transform: translateY(-2px);
}

.news-card .meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  color: var(--an-text-secondary, #64748b);
  font-size: 0.85rem;
}

.news-card .badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  background: rgba(14, 165, 233, 0.08);
  color: var(--an-text-accent, #0ea5e9);
  border: none;
}

.news-card .excerpt {
  color: var(--an-text-secondary, #64748b);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-top: 0.25rem;
  flex: 1;
  overflow: hidden;
}

/* subtle divider */
.news-card .card-footer {
  border-top: 1px solid var(--an-border-light, #e2e8f0);
  padding: 0.75rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
}

/* actionable link styles */
.news-card .read-more {
  color: var(--an-text-accent, #0ea5e9);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.news-card .read-more:hover {
  transform: translateX(4px);
  text-decoration: underline;
}

/* helper utilities */
.transition-all {
  transition: all 0.3s ease;
}

.object-fit-cover {
  object-fit: cover;
}

/* Ensure proper spacing and rounded corners visibility */
.row.mt-4 {
  margin-top: 2rem !important;
}

.row.gy-3 > * {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

/* New Card Header Styles */
.news-card-header {
  height: 110px;
  overflow: hidden;
  display: flex;
  align-items: center;
  position: relative;
}

.news-card-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.news-card:hover .news-card-bg {
  transform: scale(1.06);
}

.news-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.4) 0%,
    rgba(0, 0, 0, 0.7) 50%,
    rgba(0, 0, 0, 0.8) 100%
  );
  z-index: 1;
}

.news-card-glass {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    #0a0e1a 0%,
    #1a1f2e 30%,
    #2d3748 60%,
    #08ce7b 100%
  );
  opacity: 0.9;
}

.news-card-glass::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.3) 0%,
    rgba(0, 0, 0, 0.1) 50%,
    rgba(0, 0, 0, 0.4) 100%
  );
  z-index: 1;
}

.news-card-title-wrapper {
  padding: 0.75rem 1.5rem;
  z-index: 2;
  width: calc(100% - 60px);
  display: flex;
  align-items: center;
  margin-right: 60px;
  min-height: 0;
}

.news-card-title {
  font-family: "Space Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.6), 0 1px 4px rgba(0, 0, 0, 0.4);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.5;
  max-height: 3.6rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  text-align: left;
  color: #ffffff;
  transition: all 0.3s ease;
}

.news-card:hover .news-card-title {
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.7), 0 2px 6px rgba(0, 0, 0, 0.5);
}

.news-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
  z-index: 2;
}

.news-card-stock-logo {
  top: 0.75rem;
  right: 0.75rem;
  z-index: 15;
  opacity: 0.95;
  transition: opacity 0.3s ease;
  position: absolute;
}

.news-card:hover .news-card-stock-logo {
  opacity: 1;
}

.news-card-stock-logo .stock-logo {
  width: 40px !important;
  height: 40px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), 0 2px 4px rgba(8, 206, 123, 0.1);
  border-radius: 8px !important;
  transition: all 0.3s ease;
}

.news-card:hover .news-card-stock-logo .stock-logo {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25), 0 3px 6px rgba(8, 206, 123, 0.15);
}

/* Responsive adjustments for news cards */
@media (max-width: 767.98px) {
  .news-card {
    height: 290px;
  }

  .news-card-header {
    height: 90px;
  }

  .news-card-title-wrapper {
    padding: 0.5rem 1rem;
    width: calc(100% - 50px);
    margin-right: 50px;
  }

  .news-card-title {
    font-size: 1.2rem;
    line-height: 1.4;
    max-height: 3.36rem;
  }

  .news-card-body {
    padding: 1rem !important;
  }

  .news-card-stock-logo {
    top: 0.5rem;
    right: 0.5rem;
  }

  .news-card-stock-logo .stock-logo {
    width: 36px !important;
    height: 36px !important;
  }
}

@media (min-width: 768px) {
  .news-card-header {
    height: 110px;
  }
}
