/* produccion_contenidos/estilos/css/exten.css
   Estilos propios e independientes del módulo de extensiones. */

/* Solo para las páginas que siguen con layout_exten.html; las que heredan
   layout.html (Deportes, Noticias, Periodismo) usan el fondo del sitio. */
.exten-body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #f4f6f8;
}

/* Ancho del contenido dentro de layout.html */
.exten-contenido { max-width: 1240px; margin: 0 auto; }
.exten-contenido-angosto { max-width: 820px; }

/* Encabezado de página legible sobre la imagen de fondo del sitio */
.exten-cabecera {
  padding: 1.2rem 1.4rem;
  margin-bottom: 1.2rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.exten-cabecera h2 { font-weight: 700; }

/* ---------- Header y footer del módulo ---------- */
.exten-navbar {
  background: linear-gradient(90deg, #0F2027, #203A43, #2C5364);
  padding: 0.75rem 1.25rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}

.exten-brand {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
}

.exten-titulo {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.9rem;
}

.exten-link {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.88rem;
  transition: background 0.2s ease, color 0.2s ease;
}

.exten-link:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.exten-footer {
  background: #0F2027;
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
  padding: 1.1rem;
  margin-top: 2.5rem;
  font-size: 0.85rem;
}

/* ---------- Tarjetas y botones generales ---------- */
.exten-card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.btn-exten {
  background: #2C5364;
  color: #fff;
  border: none;
  font-weight: 600;
  padding: 0.5rem 1.4rem;
  border-radius: 8px;
}

.btn-exten:hover {
  background: #1b3540;
  color: #fff;
}

/* Volver / Salir: sólido y legible (mismo estilo que static/css/panel.css) */
.btn-volver {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.45rem 1.1rem;
  border: 2px solid #1f2347;
  border-radius: 10px;
  background: #1f2347;
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.btn-volver:hover,
.btn-volver:focus-visible { background: #cc1010; border-color: #cc1010; color: #fff; }
.btn-volver-bloque { display: flex; width: 100%; }

/* ---------- Colores de cada sección ---------- */
.feed-deportes { --acento: #059669; --acento-2: #0E7490; }
.feed-noticias { --acento: #DC2626; --acento-2: #7C2D12; }

/* Lo que el filtro/búsqueda oculta, se oculta aunque tenga otro display */
.feed [hidden] { display: none !important; }

/* ---------- Encabezado de Deportes / Noticias ---------- */
.feed-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 1.8rem 2rem;
  margin-bottom: 1.4rem;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(120deg, var(--acento), var(--acento-2));
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
}

/* Círculos decorativos de fondo */
.feed-hero::before,
.feed-hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}
.feed-hero::before { width: 260px; height: 260px; right: -60px; top: -110px; }
.feed-hero::after { width: 160px; height: 160px; right: 140px; bottom: -90px; }

.feed-hero-icono {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.2);
  font-size: 2.1rem;
}

.feed-hero-texto { flex: 1; min-width: 200px; position: relative; }
.feed-hero-texto h1 { margin: 0; font-weight: 800; font-size: 2.1rem; letter-spacing: -0.5px; }
.feed-hero-texto p { margin: 2px 0 0; opacity: 0.92; }

.feed-hero-dato {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 4px 12px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.18);
  font-size: 0.82rem;
  font-weight: 600;
}

.feed-hero-acciones { position: relative; }

/* ---------- Barra de filtros y búsqueda ---------- */
.feed-barra {
  position: sticky;
  top: 66px;          /* queda justo debajo de la barra superior del sitio */
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 12px;
  margin-bottom: 1.4rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
}

.feed-filtros { display: flex; gap: 6px; flex-wrap: wrap; }

.feed-filtro {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 15px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #374151;
  font-size: 0.88rem;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.feed-filtro:hover { border-color: rgba(127, 127, 127, 0.45); }

.feed-filtro.activo {
  border-color: transparent;
  background: var(--acento);
  color: #fff;
}

.feed-buscar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 320px;
  min-width: 200px;
  margin: 0;
  padding: 7px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #9ca3af;
}

.feed-buscar:focus-within { border-color: rgba(127, 127, 127, 0.6); }

.feed-buscar input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: #111827;
  font-size: 0.9rem;
}

/* ---------- Portada (la publicación más reciente) ---------- */
.feed-portada {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  overflow: hidden;
  margin-bottom: 2rem;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.feed-portada:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(0, 0, 0, 0.16); }

.portada-media {
  position: relative;
  min-height: 320px;
  overflow: hidden;
  background: #0f172a;
}

.portada-media img,
.portada-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.feed-portada:hover .portada-media img,
.feed-portada:hover .portada-media video { transform: scale(1.04); }

.portada-texto {
  display: flex;
  flex-direction: column;
  padding: 2rem 1.8rem;
  border-top: 5px solid var(--borde-detalle);
}

.portada-sello {
  align-self: flex-start;
  padding: 4px 12px;
  margin-bottom: 12px;
  border-radius: 6px;
  background: var(--acento);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.portada-texto h2 {
  margin: 0 0 10px;
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.2;
  color: #111827;
}

.portada-texto p {
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0 0 16px;
  color: #4b5563;
  line-height: 1.6;
  white-space: pre-line;
}

.portada-pie {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: auto;
  color: #6b7280;
  font-size: 0.88rem;
}

.portada-ver { color: var(--acento); font-weight: 700; }
.portada-ver .icono { transition: transform 0.2s ease; }
.feed-portada:hover .portada-ver .icono { transform: translateX(4px); }

/* ---------- Separador por día ---------- */
.feed-dia {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0.5rem 0 1rem;
  font-size: 1rem;
  font-weight: 700;
  color: #1f2937;
}

.feed-dia span {
  padding: 5px 16px;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
  border-left: 4px solid var(--borde-detalle);
}

.feed-dia::after {
  content: "";
  flex: 1;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0));
}

/* ---------- Tarjeta de publicación ---------- */
.pub { cursor: pointer; outline: none; }
.pub:focus-visible { box-shadow: 0 0 0 2px rgba(127, 127, 127, 0.7) !important; }   /* foco con teclado, neutro */

.pub-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.pub-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.15);
}

.pub-media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #0f172a;
  overflow: hidden;
}

.pub-media img,
.pub-media video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.pub-card:hover .pub-media img,
.pub-card:hover .pub-media video { transform: scale(1.06); }

/* Botón de play encima de los videos (se esconde mientras corre la vista previa) */
.pub-play {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--acento);
  font-size: 2rem;
  transform: translate(-50%, -50%);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.pub:hover .pub-play { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }

.pub-etiqueta,
.pub-nuevo {
  position: absolute;
  top: 10px;
  padding: 3px 11px;
  border-radius: 6px;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  pointer-events: none;
}

.pub-etiqueta { left: 10px; background: rgba(0, 0, 0, 0.6); }
.pub-nuevo { right: 10px; background: var(--acento); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25); }

.pub-cuerpo {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1rem 1.15rem 1.1rem;
}

.pub-cuerpo h3 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0 0 6px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #111827;
}

.pub-cuerpo p {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0 0 10px;
  color: #4b5563;
  font-size: 0.92rem;
  line-height: 1.55;
}

.pub-pie {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.pub-hora { color: #9ca3af; }

.pub-leer {
  color: var(--acento);
  font-size: 0.85rem;
  font-weight: 700;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.pub:hover .pub-leer,
.pub:focus-visible .pub-leer { opacity: 1; transform: none; }

/* ---------- Aparecer al hacer scroll (solo si el JS está activo) ---------- */
.feed.con-animacion .revelar {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s ease, transform 0.5s ease, box-shadow 0.25s ease;
}

.feed.con-animacion .revelar.visible { opacity: 1; transform: none; }
.feed.con-animacion .pub-card.revelar.visible:hover { transform: translateY(-6px); }
.feed.con-animacion .feed-portada.revelar.visible:hover { transform: translateY(-3px); }

@media (prefers-reduced-motion: reduce) {
  .feed.con-animacion .revelar { opacity: 1; transform: none; transition: none; }
  .pub-card:hover, .feed-portada:hover { transform: none; }
}

/* ---------- Sin publicaciones / sin resultados ---------- */
.feed-vacio,
.feed-sin-resultados {
  text-align: center;
  padding: 3.5rem 1rem;
  border-radius: 12px;
  background: #fff;
  color: #6b7280;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.feed-vacio .icono,
.feed-sin-resultados .icono { font-size: 3rem; color: var(--acento); }
.feed-vacio h3 { margin: 0.6rem 0 0.2rem; font-size: 1.2rem; color: #374151; }
.feed-sin-resultados p { margin: 0.6rem 0 0; }

/* ---------- Paginación ---------- */
.feed-paginas {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 1rem;
  color: #6b7280;
  font-size: 0.9rem;
}

.feed-paginas a {
  padding: 7px 16px;
  border-radius: 8px;
  background: var(--acento);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

/* ---------- Lector (modal con la publicación en grande) ---------- */
.lector .modal-content {
  position: relative;
  overflow: hidden;
  border: none;
  border-radius: 12px;
}

.lector-cerrar {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  padding: 10px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.55);
  opacity: 1;
}

.lector-media {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.lector-media img,
.lector-media video {
  display: block;
  max-width: 100%;
  max-height: 68vh;
  object-fit: contain;
}

.lector-media video { width: 100%; }

.lector-cuerpo { padding: 1.3rem 1.6rem 1.4rem; border-top: 4px solid var(--borde-detalle); }
.lector-fecha { color: #6b7280; font-weight: 600; }
.lector-cuerpo h2 { margin: 4px 0 8px; font-size: 1.5rem; font-weight: 800; color: #111827; }
.lector-cuerpo p { color: #374151; line-height: 1.65; white-space: pre-line; }

.lector-acciones {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 0.6rem;
}

.lector-posicion { color: #6b7280; font-size: 0.88rem; }

/* ---------- Pantalla del código de 4 dígitos ---------- */
.gate-card {
  max-width: 440px;
  margin: 2rem auto;
  padding: 2rem 1.8rem;
  text-align: center;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.12);
}

.gate-icono {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  height: 62px;
  margin-bottom: 0.6rem;
  border-radius: 12px;
  color: var(--acento);
  font-size: 1.6rem;
  background: var(--acento-suave);
}

.gate-card h2 { font-size: 1.4rem; font-weight: 700; }
.gate-codigo { letter-spacing: 0.6em; font-weight: 700; }

/* ---------- Panel de publicación ---------- */
.preview-archivo { margin-top: 10px; }
.preview-archivo img,
.preview-archivo video {
  max-width: 100%;
  max-height: 240px;
  border-radius: 10px;
  background: #000;
}

.codigo-visible {
  padding: 2px 12px;
  border-radius: 8px;
  background: #eef2f7;
  letter-spacing: 0.25em;
}

.mini-pub {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #eef0f3;
}

.mini-pub:last-child { border-bottom: none; }

.mini-pub-media {
  flex-shrink: 0;
  width: 84px;
  height: 60px;
  overflow: hidden;
  border-radius: 8px;
  background: #0f172a;
}

.mini-pub-media img,
.mini-pub-media video { width: 100%; height: 100%; object-fit: cover; display: block; }

.mini-pub-pdf {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: #fee2e2;
  color: #dc2626;
  font-size: 1.6rem;
}

.mini-pub-vence { display: block; color: #d97706; font-size: 0.78rem; font-weight: 600; }

/* Comunicados: fecha límite con atajos */
.vence-campo { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.vence-campo input { flex: 0 1 190px; }
.vence-rapido { display: flex; flex-wrap: wrap; gap: 6px; }

.vence-rapido button {
  padding: 5px 12px;
  border: 1px solid var(--tarjeta-borde, #d0d7e2);
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font-size: 0.82rem;
  font-weight: 600;
}

.vence-rapido button:hover { border-color: rgba(127, 127, 127, 0.45); }
.vence-rapido button.activo { border-color: transparent; background: var(--acento, #1d6bff); color: #fff; }

.mini-pub-texto { flex: 1; min-width: 0; }
.mini-pub-texto strong {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 0.92rem;
}

@media (max-width: 768px) {
  .feed-portada { grid-template-columns: 1fr; }
  .portada-media { min-height: 0; aspect-ratio: 16 / 10; }
  .portada-texto { padding: 1.3rem 1.2rem; }
  .portada-texto h2 { font-size: 1.4rem; }
  .feed-buscar { max-width: none; }
}

@media (max-width: 576px) {
  .feed-hero { padding: 1.4rem 1.3rem; }
  .feed-hero-texto h1 { font-size: 1.6rem; }
  .pub-leer { opacity: 1; transform: none; }
}
