/* ============================================================
   MODULE: News — Carousel + Overlay + Comments
   ============================================================ */

/* ── Carousel ───────────────────────────── */
.news-carousel {
  position: relative;
  margin: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.news-carousel::-webkit-scrollbar { display: none; }

.news-carousel-track {
  display: inline-flex;
  gap: 12px;
  padding: 0 4px 8px;
}

.news-slide {
  width: 200px;
  flex-shrink: 0;
  cursor: pointer;
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
}

@media (min-width: 768px) {
  .news-slide { width: 240px; }
}

.news-slide-content {
  position: relative;
  width: 100%;
  height: 260px;
  overflow: hidden;
  background: var(--bg-tertiary);
}

@media (min-width: 768px) {
  .news-slide-content { height: 300px; }
}

.news-slide-image {
  width: 100%;
  height: 100%;
}

.news-slide-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.news-slide-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px 16px 16px;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 60%, transparent 100%);
  color: white;
  z-index: 2;
}

.news-slide-pinned {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(240,192,0,0.8);
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.news-slide-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 4px;
}

.news-slide-meta {
  font-size: 0.75rem;
  opacity: 0.7;
}

.news-slide-stats {
  display: flex;
  gap: 12px;
  font-size: 0.7rem;
  opacity: 0.6;
  margin-top: 4px;
}

/* ── Carousel Arrows (hidden - native scroll) ── */
.news-carousel-arrow { display: none; }
.news-carousel-dots { display: none; }

/* ── Overlay ────────────────────────────── */
.news-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.news-overlay-card {
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  background: var(--bg-secondary);
  border-radius: var(--radius-xl);
  overflow-y: auto;
  position: relative;
}

.news-overlay-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
}

.news-overlay-close:active { transform: scale(0.9); }

.news-overlay-comments {
  border-top: 1px solid var(--border-subtle);
}

/* ── News Card (shared styles) ──────────── */
.news-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
}

.news-card-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--red-primary), var(--red-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.75rem;
  color: #131312;
  flex-shrink: 0;
}

.news-card-author { flex: 1; min-width: 0; }
.news-card-author-name { font-weight: 600; font-size: 0.85rem; color: var(--text-primary); }
.news-card-author-sub { font-size: 0.7rem; color: var(--text-muted); }

.news-card-category {
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.news-cat-anuncio { background: rgba(59,130,246,0.12); color: #3B82F6; }
.news-cat-comunicado { background: rgba(245,158,11,0.12); color: #F59E0B; }
.news-cat-convocatoria { background: rgba(240,192,0,0.12); color: var(--red-accent); }
.news-cat-reconocimiento { background: rgba(34,197,94,0.12); color: #22C55E; }

.news-card-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--bg-tertiary);
}

.news-card-image img { width: 100%; height: 100%; object-fit: cover; }

.news-card-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px 4px;
}

.news-like-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-family: var(--font-body);
  transition: all 0.15s ease;
}

.news-like-btn.liked { color: var(--red-accent); }
.news-like-btn svg { transition: transform 0.2s ease; }
.news-like-btn.liked svg { transform: scale(1.15); }
.news-like-count { font-weight: 600; font-size: 0.8rem; }

.news-card-body { padding: 8px 16px 12px; }
.news-card-title { font-family: var(--font-heading); font-weight: 700; font-size: 0.95rem; color: var(--text-primary); margin-bottom: 4px; }
.news-card-text { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.5; }

/* ── Comments ───────────────────────────── */
.news-comments-list {
  padding: 8px 16px;
  max-height: 220px;
  overflow-y: auto;
}

.news-comment {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.news-comment:last-child { border-bottom: none; }

.news-comment-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.news-comment-body { flex: 1; min-width: 0; }
.news-comment-author { font-size: 0.8rem; font-weight: 600; color: var(--text-primary); }
.news-comment-author span { font-weight: 400; color: var(--text-muted); font-size: 0.7rem; margin-left: 6px; }
.news-comment-text { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.4; margin-top: 2px; }
.news-comment-time { font-size: 0.65rem; color: var(--text-muted); margin-top: 3px; }

.news-comment-input-wrap {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--border-subtle);
  align-items: center;
}

.news-comment-input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: var(--font-body);
  outline: none;
}

.news-comment-input:focus { border-color: var(--red-primary); }
.news-comment-input::placeholder { color: var(--text-muted); }

.news-comment-send {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--red-primary), var(--red-accent));
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.news-comment-send:active { transform: scale(0.9); }
.news-comment-send:disabled { opacity: 0.4; }
