/* ============================================================
   NEWS PAGE - Estilos específicos
   ============================================================ */

/* ===== HERO SECTION ===== */
.news-hero {
  position: relative;
  background: #f5f5f5;
  padding: 120px 24px 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-top: -80px;
  padding-top: 160px;
  min-height: 500px;
}

/* Contenido centrado */
.news-hero__content {
  position: relative;
  z-index: 1;
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
  animation: heroFadeIn 0.8s ease forwards;
}

@keyframes heroFadeIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Badge */
.news-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background:none;
  border:none;
  padding: 8px 20px 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #2596BE;
  margin-bottom: 28px;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
}


.news-hero__badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2596BE;
  display: inline-block;
  animation: pulse-dot 2s ease infinite;
  box-shadow: 0 0 20px rgba(37, 150, 190, 0.3);
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}

/* Título */
.news-hero h1 {
  font-size: clamp(42px, 6vw, 64px);
  font-weight: 400;
  color: #0f172a;
  margin-bottom: 18px;
  letter-spacing: -1.5px;
  line-height: 1.1;
}

.news-hero h1 .highlight {
  background: linear-gradient(135deg, #2596BE 0%, #4FC3F7 50%, #81D4FA 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
}

/* Descripción */
.news-hero__description {
  font-size: clamp(16px, 1.5vw, 18px);
  color: #475569;
  max-width: 560px;
  margin: 0 auto 36px;
  line-height: 1.8;
  font-weight: 300;
  letter-spacing: 0.2px;
}

/* ===== SEARCH BAR EN HERO ===== */
.news-hero__search {
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.search-wrapper .search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.search-wrapper .search-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: #94a3b8;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.3s ease;
}

.search-wrapper input {
  flex: 1;
  padding: 16px 24px 16px 58px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-family: inherit;
  background: #ffffff;
  color: #0f172a;
  transition: all 0.35s ease;
  outline: none;
  width: 100%;
}

.search-wrapper input::placeholder {
  color: #94a3b8;
}

.search-wrapper input:focus {
  border-color: #2596BE;
  box-shadow: 0 4px 20px rgba(37, 150, 190, 0.08);
}

.search-wrapper input:focus ~ .search-icon svg,
.search-wrapper input:focus + .search-icon svg {
  stroke: #2596BE;
}

/* Search Button */
.search-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: #2596BE;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 10px 22px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  z-index: 1;
}

.search-btn:hover {
  background: #1a7a9e;
}

.search-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s;
}

.search-btn:hover svg {
  transform: translateX(3px);
}

/* ===== NEWS SECTION ===== */
.news-section {
  background: #f5f5f5;
  padding: 60px 0 80px;
}

/* Results Meta */
.results-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}

.results-meta h2 {
  font-size: 20px;
  font-weight: 600;
  color: #1E2532;
  letter-spacing: -0.5px;
}

.results-meta h2 span {
  font-weight: 400;
  color: #828BA2;
  font-size: 16px;
  margin-left: 8px;
}

.clear-btn {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #828BA2;
  font-size: 14px;
  cursor: pointer;
  padding: 8px 18px;
  border-radius: 12px;
  transition: 0.2s;
  font-family: inherit;
  display: none;
  align-items: center;
  gap: 6px;
}

.clear-btn:hover {
  background: #f1f5f9;
  color: #1E2532;
  border-color: #cbd5e1;
}

.clear-btn.visible {
  display: inline-flex;
}

.clear-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ===== NEWS GRID ===== */
#news-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 28px;
}

/* ===== NEWS CARD ===== */
.news-card {
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.04);
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 420px;
  opacity: 0;
  animation: cardFadeIn 0.5s ease forwards;
}

.news-card:nth-child(1) { animation-delay: 0.05s; }
.news-card:nth-child(2) { animation-delay: 0.1s; }
.news-card:nth-child(3) { animation-delay: 0.15s; }
.news-card:nth-child(4) { animation-delay: 0.2s; }
.news-card:nth-child(5) { animation-delay: 0.25s; }
.news-card:nth-child(6) { animation-delay: 0.3s; }

@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.news-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.06);
  border-color: rgba(37, 150, 190, 0.12);
}

/* Card Image */
.news-card__image-wrapper {
  position: relative;
  overflow: hidden;
  background: #eef2f6;
  height: 220px;
  flex-shrink: 0;
}

.news-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
  display: block;
}

.news-card:hover .news-card__image {
  transform: scale(1.03);
}

/* Date Badge sobre la imagen */
.news-card__date-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  color: #ffffff;
  padding: 6px 16px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  letter-spacing: 0.2px;
  z-index: 2;
  transition: all 0.3s ease;
}

.news-card__date-badge svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: #94a3b8;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.news-card:hover .news-card__date-badge {
  background: rgba(15, 23, 42, 0.92);
  transform: scale(1.02);
}

/* Card Body */
.news-card__body {
  padding: 22px 24px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.news-card__title {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 12px;
  color: #0f172a;
  letter-spacing: -0.5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-wrap: break-word;
  hyphens: auto;
}

.news-card__description {
  color: #475569;
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 16px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-wrap: break-word;
  hyphens: auto;
}

/* Card Footer */
.news-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid #f1f5f9;
  margin-top: auto;
  flex-shrink: 0;
}

.news-card__author {
  display: flex;
  align-items: center;
  gap: 10px;
}

.news-card__author .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #dbeafe;
  color: #1d4ed8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
}

.news-card__author .name {
  font-weight: 600;
  font-size: 14px;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.btn-read-more {
  background: none;
  border: none;
  color: #2596BE;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  padding: 4px 0;
  border-radius: 6px;
  transition: all 0.2s;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.btn-read-more:hover {
  color: #1a7a9e;
  transform: translateX(4px);
}

.btn-read-more svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s;
}

.btn-read-more:hover svg {
  transform: translateX(4px);
}

/* ===== SKELETON ===== */
.skeleton-card {
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.04);
  min-height: 420px;
  display: flex;
  flex-direction: column;
}

.skeleton-image {
  height: 220px;
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease infinite;
}

.skeleton-body {
  padding: 22px 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.skeleton-title {
  height: 24px;
  width: 85%;
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease infinite;
  border-radius: 6px;
}

.skeleton-date {
  height: 16px;
  width: 40%;
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease infinite;
  border-radius: 6px;
}

.skeleton-description {
  height: 60px;
  width: 100%;
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease infinite;
  border-radius: 6px;
  flex: 1;
}

.skeleton-footer {
  height: 20px;
  width: 50%;
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease infinite;
  border-radius: 6px;
  margin-top: auto;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== LOADING MORE ===== */
.loading-more {
  grid-column: 1 / -1;
  padding: 30px 20px;
  text-align: center;
  color: #828BA2;
}

.loading-more .spinner {
  display: inline-block;
  width: 30px;
  height: 30px;
  border: 3px solid rgba(37, 150, 190, 0.1);
  border-top-color: #2596BE;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-more p {
  margin-top: 10px;
  font-size: 14px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== EMPTY / ERROR STATES ===== */
.empty-state,
.error-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 30px;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.empty-state svg {
  width: 48px;
  height: 48px;

  margin-bottom: 4px;
}

.empty-state p,
.error-state p {
  font-size: 18px;
  font-weight: 500;
  color: #1E2532;
}

.empty-state__sub,
.error-state__sub {
  font-size: 14px;
  color: #828BA2;
  margin-top: 6px;
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(11, 14, 19, 0.7);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: #ffffff;
  border-radius: 16px;
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 0;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2);
  position: relative;
  animation: modalSlideUp 0.3s ease;
}

@keyframes modalSlideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: 0.2s;
  line-height: 1;
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.modal-close:hover {
  background: #ffffff;
  transform: scale(1.05);
}

.modal-close svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.modal-image-wrapper {
  position: relative;
  width: 100%;
  height: 280px;
  overflow: hidden;
}

.modal-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-date-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  color: #ffffff;
  padding: 6px 16px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-date-badge svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: #94a3b8;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.modal-title {
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
  padding: 24px 32px 0 32px;
  letter-spacing: -0.5px;
  line-height: 1.3;
}

.modal-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 32px 0 32px;
  font-size: 14px;
  color: #828BA2;
  flex-wrap: wrap;
}

.modal-meta .author-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-meta .author-badge .avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #dbeafe;
  color: #1d4ed8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
}

.modal-meta .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #cbd5e1;
}

.modal-meta .modal-date {
  display: flex;
  align-items: center;
  gap: 6px;
}

.modal-meta .modal-date svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: #94a3b8;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.modal-description {
  font-size: 16px;
  line-height: 1.8;
  color: #1E2532;
  padding: 16px 32px 32px 32px;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.modal-content::-webkit-scrollbar {
  width: 10px;
}
.modal-content::-webkit-scrollbar-track {
  background: transparent;
  margin-block: 12px;
}
.modal-content::-webkit-scrollbar-thumb {
  background-color: rgba(160, 165, 180, 0.25);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: padding-box;
}
.modal-content::-webkit-scrollbar-thumb:hover {
  background-color: rgba(160, 165, 180, 0.4);
}
.modal-content::-webkit-scrollbar-button {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.modal-content {
  scrollbar-width: thin;
  scrollbar-color: rgba(160, 165, 180, 0.25) transparent;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .news-hero {
    padding: 140px 20px 60px;
    min-height: 400px;
  }

  .news-hero h1 {
    font-size: clamp(32px, 7vw, 42px);
  }

  .news-hero__description {
    font-size: 15px;
    padding: 0 10px;
  }

  .search-wrapper input {
    font-size: 15px;
    padding: 14px 20px 14px 52px;
  }

  .search-wrapper .search-icon {
    left: 16px;
  }

  .search-wrapper .search-icon svg {
    width: 18px;
    height: 18px;
  }

  .search-btn {
    padding: 8px 16px;
    font-size: 13px;
  }
  .search-btn span {
    display: none;
  }
  .search-btn svg {
    width: 18px;
    height: 18px;
  }

  #news-container {
    grid-template-columns: 1fr;
  }

  .news-card {
    min-height: 380px;
  }

  .news-card__image-wrapper {
    height: 180px;
  }

  .modal-image-wrapper {
    height: 200px;
  }

  .modal-title {
    font-size: 20px;
    padding: 20px 24px 0 24px;
  }

  .modal-meta {
    padding: 10px 24px 0 24px;
  }

  .modal-description {
    padding: 14px 24px 24px 24px;
    font-size: 15px;
  }

  .modal-content {
    max-width: 100%;
    max-height: 95vh;
  }

  .results-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .news-hero h1 {
    font-size: 28px;
  }

  .news-hero__description {
    font-size: 13px;
  }

  .search-wrapper input {
    font-size: 14px;
    padding: 12px 16px 12px 46px;
  }

  .search-wrapper .search-icon {
    left: 14px;
  }

  .search-wrapper .search-icon svg {
    width: 16px;
    height: 16px;
  }

  .news-card__image-wrapper {
    height: 160px;
  }

  .modal-image-wrapper {
    height: 160px;
  }
}