/*
===============================================
MODERN NEWS HUB STYLES
Medical Theme Integration
===============================================
*/

/* Main Section */
#modern-news-hub {
  background: linear-gradient(135deg, #1d4577 0%, #2a5a8a 50%, #e6f5fa 100%);
  padding: 100px 0;
  position: relative;
  overflow: hidden;
}

#modern-news-hub::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0.4;
}

/* Header Section */
.news-hero-header {
  position: relative;
  z-index: 2;
  margin-bottom: 60px;
}

.news-badge-modern {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(15px);
  padding: 12px 28px;
  border-radius: 50px;
  color: white;
  font-weight: 600;
  margin-bottom: 25px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  transition: all 0.3s ease;
  box-shadow: 0 8px 32px rgba(29, 69, 119, 0.1);
}

.news-badge-modern:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(29, 69, 119, 0.2);
}

.news-badge-modern i {
  color: #e6f5fa;
  font-size: 1.1rem;
}

.news-title-gradient {
  font-size: 3.5rem;
  font-weight: 800;
  background: linear-gradient(45deg, #ffffff, #e6f5fa, #ffffff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 20px;
  text-shadow: 0 4px 8px rgba(29, 69, 119, 0.3);
  letter-spacing: -0.02em;
}

.news-subtitle {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.2rem;
  font-weight: 300;
  max-width: 600px;
  margin: 0 auto 30px;
  line-height: 1.6;
}

.title-decorative-line {
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, #1d4577, #e6f5fa, #1d4577);
  margin: 0 auto;
  border-radius: 2px;
  position: relative;
  box-shadow: 0 2px 8px rgba(29, 69, 119, 0.3);
}

.title-decorative-line::after {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(90deg, #1d4577, #e6f5fa, #1d4577);
  border-radius: 4px;
  filter: blur(4px);
  opacity: 0.6;
  z-index: -1;
}

/* Content Wrapper */
.news-content-wrapper {
  position: relative;
  z-index: 2;
}

.news-grid-modern {
  display: flex;
  gap: 30px;
  margin-bottom: 40px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 20px 0;
  cursor: grab;
}

.news-grid-modern:active {
  cursor: grabbing;
}

/* Hide scrollbar but keep functionality */
.news-grid-modern::-webkit-scrollbar {
  display: none;
}

.news-grid-modern {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Carousel mode styles */
.news-grid-modern.carousel-initialized {
  display: flex;
}

.news-card-container {
  flex: 0 0 350px;
  min-width: 350px;
  height: auto;
}

/* Grid mode for larger screens */
@media (min-width: 1200px) {
  .news-grid-modern {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
    min-height: auto;
  }

  .news-grid-modern.carousel-initialized {
    display: grid;
  }

  .news-grid-modern.carousel-initialized .news-card-modern {
    position: relative;
    width: auto;
  }

  .news-navigation-modern {
    display: none;
  }

  .news-dots-indicator {
    display: none;
  }

  .news-view-all-container {
    margin-top: 50px;
  }
}

/* News Card BEM Structure */
.news-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.4s ease;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 350px;
  flex: 0 0 350px;
}

.news-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #1d4577, #e6f5fa);
  z-index: 1;
}

.news-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 25px 50px rgba(29, 69, 119, 0.25);
}

.news-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.news-card__link:hover,
.news-card__link:focus {
  text-decoration: none;
  color: inherit;
}

/* Image Section */
.news-card__image-wrapper {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
  flex-shrink: 0;
}

.news-card__image-wrapper img,
.news-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
  display: block;
}

.news-card:hover .news-card__image-wrapper img,
.news-card:hover .news-card__image {
  transform: scale(1.05);
}

.news-card__image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    transparent 60%,
    rgba(29, 69, 119, 0.1) 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.news-card:hover .news-card__image-overlay {
  opacity: 1;
}

/* Content Section */
.news-card__content {
  padding: 25px;
  display: flex;
  flex-direction: column;
  flex: 1;
  position: relative;
}

.news-card__header {
  margin-bottom: 15px;
}

.news-card__title {
  color: #1d4577;
  font-weight: 700;
  font-size: 22px; /* Alineado con testimonios y otros títulos del tema */
  line-height: 1.3;
  margin: 0;
  transition: color 0.3s ease;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-family: "poppins", sans-serif;
}

.news-card:hover .news-card__title {
  color: #2a5a8a;
}

.news-card__body {
  flex: 1;
  margin-bottom: 15px;
}

.news-card__excerpt {
  color: #464648;
  line-height: 1.6;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-align: left;
  font-size: 17px;
  font-family: "poppins", sans-serif;
}

.news-card__meta {
  margin-top: auto;
  padding-top: 15px;
  border-top: 1px solid rgba(29, 69, 119, 0.1);
}

.news-card__date {
  color: #3e473d;
  font-size: 0.85rem;
  opacity: 0.8;
  display: flex;
  align-items: center;
  gap: 8px;
}

.news-card__date::before {
  content: "\f017"; /* Font Awesome clock icon */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  color: #1d4577;
  font-size: 0.8rem;
}

/* Card Content Styling */
.news-card-modern .node__content {
  padding: 25px;
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.news-card-footer {
  padding: 0 25px 25px 25px;
  border-top: 1px solid rgba(29, 69, 119, 0.1);
  margin-top: auto;
  padding-top: 20px;
}

.news-card-modern .field--name-title h2,
.news-card-modern .field--name-title h3 {
  color: #1d4577;
  font-weight: 700;
  margin-bottom: 15px;
  line-height: 1.3;
  font-size: 33px;
  transition: color 0.3s ease;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-modern:hover .field--name-title h2,
.news-card-modern:hover .field--name-title h3 {
  color: #2a5a8a;
  text-decoration: none;
}

.news-card-modern .field--name-body,
.news-card-modern .field--name-field-summary {
  color: #464648;
  line-height: 1.6;
  margin-bottom: 20px;
  flex: 1;
}

/* Text truncation for content */
.news-card-modern .field--name-body p,
.news-card-modern .field--name-field-summary p {
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-align: left;
}

/* Read more button */
.news-read-more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #1d4577, #2a5a8a);
  color: white;
  padding: 12px 24px;
  border-radius: 25px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(29, 69, 119, 0.2);
  width: 100%;
  text-align: center;
}

.news-read-more-btn:hover {
  background: linear-gradient(135deg, #2a5a8a, #1d4577);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(29, 69, 119, 0.3);
  text-decoration: none;
  color: white;
}

.news-read-more-btn i {
  font-size: 0.8rem;
  transition: transform 0.3s ease;
}

.news-read-more-btn:hover i {
  transform: translateX(3px);
}

.news-card-modern .field--name-created,
.news-card-modern .field--name-field-date {
  color: #3e473d;
  font-size: 0.85rem;
  opacity: 0.8;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.news-card-modern .field--name-created::before,
.news-card-modern .field--name-field-date::before {
  content: "\f017"; /* Font Awesome clock icon */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  color: #1d4577;
}

/* Remove underlines from all links inside cards */
.news-card-modern a {
  text-decoration: none;
}

.news-card-modern a:hover {
  text-decoration: none;
}

/* Navigation */
.news-navigation-modern {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 40px;
}

.nav-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: white;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 25px rgba(29, 69, 119, 0.1);
}

.nav-btn:hover {
  background: rgba(29, 69, 119, 0.8);
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(29, 69, 119, 0.3);
  border-color: #e6f5fa;
}

.nav-btn:active {
  transform: translateY(-1px);
}

/* View All News Button */
.news-view-all-container {
  display: flex;
  justify-content: center;
  margin-top: 40px;
}

.news-view-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.15),
    rgba(255, 255, 255, 0.25)
  );
  backdrop-filter: blur(15px);
  color: white;
  padding: 16px 32px;
  border-radius: 50px;
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 600;
  transition: all 0.4s ease;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px rgba(29, 69, 119, 0.2);
  position: relative;
  overflow: hidden;
}

.news-view-all-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s ease;
}

.news-view-all-btn:hover::before {
  left: 100%;
}

.news-view-all-btn:hover {
  background: linear-gradient(135deg, #1d4577, #2a5a8a);
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 15px 40px rgba(29, 69, 119, 0.3);
  border-color: #e6f5fa;
  text-decoration: none;
  color: white;
}

.news-view-all-btn i {
  font-size: 1rem;
  transition: transform 0.3s ease;
}

.news-view-all-btn:hover i {
  transform: translateX(5px);
}

.news-view-all-btn:active {
  transform: translateY(-1px) scale(1.02);
}

/* Responsive Design */
@media (max-width: 768px) {
  #modern-news-hub {
    padding: 60px 0;
  }

  .news-title-gradient {
    font-size: 2.5rem;
  }

  .news-grid-modern {
    gap: 20px;
    padding: 20px 15px;
  }

  .news-card-container {
    min-width: 300px;
    flex: 0 0 300px;
  }

  .news-card {
    min-width: 300px;
    flex: 0 0 300px;
  }

  .news-card__image-wrapper {
    height: 160px;
  }

  .news-badge-modern {
    padding: 10px 20px;
    font-size: 0.9rem;
  }

  .news-navigation-modern {
    gap: 15px;
  }

  .nav-btn {
    width: 50px;
    height: 50px;
    font-size: 18px;
  }

  .news-view-all-btn {
    padding: 14px 28px;
    font-size: 1rem;
  }

  .news-view-all-container {
    margin-top: 30px;
  }
}

@media (max-width: 480px) {
  .news-title-gradient {
    font-size: 2rem;
  }

  .news-subtitle {
    font-size: 1rem;
    padding: 0 20px;
  }

  .news-card-container {
    min-width: 280px;
    flex: 0 0 280px;
  }

  .news-card {
    min-width: 280px;
    flex: 0 0 280px;
  }

  .news-card__content {
    padding: 20px;
  }

  .news-card__image-wrapper {
    height: 140px;
  }

  .news-view-all-btn {
    padding: 12px 24px;
    font-size: 0.95rem;
  }
}

/* Entrance Animations */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.news-card-modern {
  animation: slideInUp 0.6s ease forwards;
}

.news-card-modern:nth-child(1) {
  animation-delay: 0.1s;
}

.news-card-modern:nth-child(2) {
  animation-delay: 0.2s;
}

.news-card-modern:nth-child(3) {
  animation-delay: 0.3s;
}

.news-card-modern:nth-child(4) {
  animation-delay: 0.4s;
}

.news-hero-header {
  animation: fadeInScale 0.8s ease forwards;
}

/* Accessibility & Performance */
@media (prefers-reduced-motion: reduce) {
  .news-card-modern,
  .news-hero-header,
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .news-card-modern {
    border: 2px solid #1d4577;
  }

  .news-badge-modern {
    background: #1d4577;
    border-color: #1d4577;
  }
}

/* News Grid Page Styles */
#modern-news-grid-page {
  background: linear-gradient(135deg, #1d4577 0%, #2a5a8a 50%, #e6f5fa 100%);
  padding: 100px 0;
  position: relative;
  overflow: hidden;
  min-height: 100vh;
}

#modern-news-grid-page::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0.4;
}

/* Page Grid Layout */
.news-grid-page {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin-bottom: 40px;
  position: relative;
  z-index: 2;
}

/* Ensure cards in page view have proper sizing */
.news-grid-page .news-card-container {
  display: flex;
  flex-direction: column;
}

.news-grid-page .news-card,
.news-grid-page .news-card-modern {
  height: 100%;
  min-width: auto;
  flex: 1;
  min-height: 450px;
}

/* Image styling for page cards */
.news-grid-page .news-card__image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Responsive grid layout for page */
@media (max-width: 1200px) {
  .news-grid-page {
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
  }
}

@media (max-width: 768px) {
  #modern-news-grid-page {
    padding: 60px 0;
  }

  .news-grid-page {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 0 15px;
  }

  .news-card-container .news-card,
  .news-card-container .news-card-modern {
    min-height: 400px;
  }
}

@media (max-width: 480px) {
  #modern-news-grid-page {
    padding: 40px 0;
  }

  .news-grid-page {
    gap: 15px;
  }

  .news-card-container .news-card,
  .news-card-container .news-card-modern {
    min-height: 380px;
  }
}

/* Pagination Styles for News Page */
#modern-news-grid-page .pager,
.news-grid-page + .pager {
  margin-top: 60px;
  position: relative;
  z-index: 2;
}

.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 20px 0;
  flex-wrap: wrap;
}

.pager__item {
  display: inline-flex;
  list-style: none;
}

.pager__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 45px;
  height: 45px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  color: white;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(29, 69, 119, 0.1);
}

.pager__link:hover,
.pager__item--active .pager__link,
.pager__link--is-active {
  background: rgba(29, 69, 119, 0.8);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(29, 69, 119, 0.3);
  border-color: #e6f5fa;
  color: white;
  text-decoration: none;
}

.pager__item--first .pager__link,
.pager__item--previous .pager__link,
.pager__item--next .pager__link,
.pager__item--last .pager__link {
  font-size: 0.9rem;
  padding: 10px 15px;
  border-radius: 25px;
  min-width: auto;
}

.pager__link--previous i,
.pager__link--next i {
  margin: 0 5px;
}

/* Print styles */
@media print {
  #modern-news-hub,
  #modern-news-grid-page {
    background: white !important;
    padding: 20px 0;
  }

  .news-card-modern {
    background: white;
    box-shadow: none;
    border: 1px solid #1d4577;
    break-inside: avoid;
    margin-bottom: 20px;
  }

  .news-navigation-modern,
  .pager {
    display: none;
  }

  .news-grid-page {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
}

.news-card__header .news-card__link {
  display: none;
}
