/**
 * news.css
 * Styles for the News & Events page.
 * Follows the "Clean-Tech" aesthetic of IPS Software.
 */

/* ═══════════════════════════════════════════════════════════════
   HERO SECTION
   ═══════════════════════════════════════════════════════════════ */

.news-hero-title {
  /* Match style.css clamp but specific to news if needed */
  font-size: clamp(2.5rem, 6vw, 4.25rem);
}

/* ═══════════════════════════════════════════════════════════════
   NEWS GRID
   ═══════════════════════════════════════════════════════════════ */
.news-section {
  padding: var(--section-padding) 0;
  background-color: var(--ips-bg-light);
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 60px 40px;
  margin-top: 60px;
  position: relative;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.news-card {
  width: 100%;
  background: var(--ips-white);
  border-radius: 16px;
  overflow: visible;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(0, 0, 0, 0.05);
  position: relative;
}

/* Red Dotted Connector Line (Horizontal) */
.news-card::after {
  content: '';
  position: absolute;
  top: 40%;
  right: -40px;
  /* Linking distance */
  width: 40px;
  height: 2px;
  background-image: linear-gradient(to right, var(--ips-red) 50%, transparent 50%);
  background-size: 8px 2px;
  background-repeat: repeat-x;
  opacity: 0.6;
  z-index: -1;
  animation: move-line 0.6s linear infinite;
}

@keyframes move-line {
  from {
    background-position: 0 0;
  }

  to {
    background-position: 8px 0;
  }
}

/* Remove connector on every 3rd card in a row */
.news-card:nth-child(3n)::after {
  display: none;
}

.news-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  border-color: rgba(200, 16, 46, 0.1);
}

.news-img-wrap {
  position: relative;
  height: 240px;
  /* Balanced height for 3x3 grid */
  overflow: hidden;
  border-radius: 16px 16px 0 0;
}

.news-img-placeholder {
  height: 100%;
  width: 100%;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ips-subtle);
  font-size: 3rem;
  position: relative;
}

.news-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.news-card:hover .news-img {
  transform: scale(1.08);
}

.news-date-badge {
  display: inline-block;
  padding: 6px 10px;
  background: rgba(var(--ips-red-rgb), 0.08);
  border: 1px solid rgba(var(--ips-red-rgb), 0.2);
  border-radius: 50px;
  color: var(--ips-red);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
  width: fit-content;
}

.news-date-badge span {
  display: inline;
  line-height: inherit;
}

.news-date-badge .day {
  font-weight: 800;
}

.news-date-badge .year {
  opacity: 0.8;
}

.news-info {
  padding: 20px 24px;
  /* Smaller padding */
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.news-category {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ips-red);
  margin-bottom: 12px;
  display: block;
}

.news-info h3 {
  font-size: 1.2rem;
  /* Smaller title */
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--ips-text);
  line-height: 1.4;
}

.news-info p {
  color: var(--ips-muted);
  font-size: 0.85rem;
  /* Smaller text */
  line-height: 1.5;
  margin-bottom: 15px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  overflow: hidden;
}

.news-read-more {
  margin-top: auto;
  font-weight: 700;
  color: var(--ips-red);
  text-decoration: none;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.news-read-more:hover {
  color: var(--ips-red);
  gap: 12px;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE ADJUSTMENTS
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 991px) {
  .hero-split-container {
    flex-direction: column;
    padding-top: 40px;
  }

  .news-hero-journey {
    display: none;
  }

  .news-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    max-width: 100%;
  }

  .news-card::after {
    display: none;
    /* Hide connectors on tablet/mobile if they break layout */
  }
}

@media (max-width: 768px) {
  .news-hero {
    min-height: 70vh;
    padding-top: 120px;
    padding-bottom: var(--section-padding-mobile);
  }

  .news-section {
    padding: var(--section-padding-mobile) 0;
  }

  .news-grid {
    grid-template-columns: 1fr;
  }

  .news-img-wrap {
    height: 240px;
  }
}