.news-gallery-section {
  width: 100%;
  max-width: 100vw;
  padding: 40px 0;
  background: #f8f9fa;
  box-sizing: border-box;
  overflow: hidden;
}

.section-title {
  text-align: center;
  margin-bottom: 30px;
  padding: 0 20px;
}

.section-title h2 {
  font-family: "DM Sans", sans-serif;
  font-size: 32px;
  font-weight: 700;
  color: #333;
  margin: 0;
}

.news-gallery-container {
  width: 100%;
  max-width: 100vw;
  position: relative;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.news-gallery {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  padding: 10px 20px;
  margin: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.3) transparent;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  width: 100%;
  max-width: 100vw;
  transition: justify-content 0.3s ease;
}

.news-gallery.centered {
  justify-content: center;
  overflow-x: visible;
}

.news-gallery::-webkit-scrollbar {
  height: 8px;
}

.news-gallery::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}

.news-gallery::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
}

.news-gallery::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.5);
}

.news-card {
  min-width: 300px;
  max-width: 300px;
  width: 300px;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  flex-shrink: 0;
}

.news-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.news-card-image {
  width: 100%;
  height: 180px;
  overflow: hidden;
}

.news-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

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

.news-card-content {
  padding: 20px;
  box-sizing: border-box;
}

.news-card-content h3 {
  font-family: "DM Sans", sans-serif;
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 10px 0;
  color: #333;
  line-height: 1.3;
  word-wrap: break-word;
}

.news-card-content p {
  font-family: "DM Sans", sans-serif;
  font-size: 14px;
  color: #666;
  line-height: 1.5;
  margin: 0 0 15px 0;
  word-wrap: break-word;
}

.news-date {
  font-family: "DM Sans", sans-serif;
  font-size: 12px;
  color: #999;
  font-weight: 500;
}

.news-category {
  display: inline-block;
  background: #007bff;
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.news-category.project-uta {
  background: #28a745;
}
.news-category.bobi {
  background: #17a2b8;
}
.news-category.estudio {
  background: #6f42c1;
}
.news-category.colaboracion {
  background: #fd7e14;
}
.news-category.resumen {
  background: #6c757d;
}
.news-category.comunidad {
  background: #e83e8c;
}

.news-card.clickable {
  cursor: pointer;
}

.news-card.clickable:hover {
  transform: translateY(-8px);
}

.gallery-controls {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: calc(100% - 80px);
  left: 40px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  padding: 0;
  box-sizing: border-box;
  z-index: 10;
  transition: opacity 0.3s ease;
}

.gallery-controls.hidden {
  opacity: 0;
  pointer-events: none;
}

.gallery-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  pointer-events: all;
  backdrop-filter: blur(10px);
  flex-shrink: 0;
}

.gallery-btn:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: scale(1.1);
}

.gallery-btn:active {
  transform: scale(0.95);
}

.loading-placeholder {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
  width: 100%;
  max-width: 100%;
}

.loading-placeholder p {
  font-family: "DM Sans", sans-serif;
  color: #666;
  font-size: 16px;
}

@media (max-width: 768px) {
  .news-gallery-section {
    padding: 30px 0;
    max-width: 100vw;
  }

  .section-title {
    padding: 0 15px;
  }

  .section-title h2 {
    font-size: 28px;
  }

  .news-gallery {
    padding: 10px 15px;
    max-width: 100vw;
  }

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

  .gallery-controls {
    display: none;
  }

  .news-gallery {
    gap: 15px;
  }
}

@media (max-width: 480px) {
  .news-gallery-section {
    padding: 30px 0;
  }

  .section-title {
    padding: 0 10px;
  }

  .news-gallery {
    padding: 10px 10px;
  }

  .news-card {
    min-width: 250px;
    max-width: 250px;
    width: 250px;
  }

  .news-card-content {
    padding: 15px;
  }

  .news-card-content h3 {
    font-size: 16px;
  }

  .news-card-content p {
    font-size: 13px;
  }

  .section-title h2 {
    font-size: 24px;
  }
}
