/* =========================
   Noticiero King - estilos.css (full)
   NK_CSS: v16
   ========================= */

/* ====== Design Tokens ====== */
:root{
  --nk-bg:#f6f8fb;
  --nk-surface:#ffffff;
  --nk-primary:#0d6efd;
  --nk-primary-strong:#0857c8;
  --nk-text:#0f172a;
  --nk-muted:#475569;
  --nk-chip:#eef2f7;
  --nk-chip-hover:#e2e8f0;
  --nk-border:#e5e7eb;
  --nk-shadow:0 6px 26px rgba(2,12,27,.08);
  --nk-shadow-soft:0 3px 12px rgba(2,12,27,.06);
  --nk-radius:16px;

  /* Overlays */
  --nk-overlay-grad: linear-gradient(180deg, rgba(0,0,0,0) 30%, rgba(0,0,0,.55) 100%);

  /* Alturas estables (evita “salto” entre slides) */
  --masthead-h: 420px; /* desktop por defecto */
  --ads-h: 220px;      /* alto fijo anuncios */
}

:root.dark{
  --nk-bg:#0b1020;
  --nk-surface:#111827;
  --nk-text:#e5e7eb;
  --nk-muted:#94a3b8;
  --nk-chip:#1f2937;
  --nk-chip-hover:#2a3648;
  --nk-border:#1f2937;
  --nk-shadow:0 6px 26px rgba(0,0,0,.45);
  --nk-shadow-soft:0 3px 12px rgba(0,0,0,.35);
  --nk-overlay-grad: linear-gradient(180deg, rgba(0,0,0,0) 25%, rgba(0,0,0,.65) 100%);
}

/* ====== Base ====== */
html, body{
  background: linear-gradient(180deg, #f8fbff 0%, #fff 60%);
  color: var(--nk-text);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin:0; padding:0;
  min-height: 100%;
}
:root.dark body{
  background: linear-gradient(180deg, #0b1020 0%, #0f172a 60%);
}
.container{
  max-width: 1080px;
  position: relative;
  z-index: 2;
}

/* Evitar franja blanca por colapso de márgenes */
body{ padding-top:14px; }
.container{ margin-top:0 !important; }

/* =========================================================
   MASTHEAD (slider portada + título y categorías)
   ========================================================= */
.masthead-full{ position: relative; isolation: isolate; }

/* Altura estable del carrusel (evita CLS y “salto”) */
.masthead-full .carousel,
.masthead-full .carousel-inner,
.masthead-full .carousel-item{
  height: var(--masthead-h);
}
.masthead-full .carousel-item{
  background: var(--nk-bg);
  overflow: hidden; /* recorte limpio del cover */
}
:root.dark .masthead-full .carousel-item{
  background: #0f172a;
}

/* La imagen SIEMPRE llena el alto y ancho del slide */
.masthead-full .carousel-item img{
  display:block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* foco vertical por item: definir --mast-focal en el HTML si querés */
  object-position: 50% var(--mast-focal, 62%);
}

/* sombreado para legibilidad sobre la imagen */
.masthead-shade{
  position: absolute; inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0,0,0,.45) 0%,
    rgba(0,0,0,.35) 50%,
    rgba(0,0,0,.25) 100%
  );
  z-index: 1;
}

/* capa con el contenido flotante */
.masthead-overlay{
  position: absolute; inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-top: 14px;
}
.brand-title{
  color:#fff !important;
  font-weight:800;
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  letter-spacing:.2px;
  text-shadow: 0 2px 10px rgba(0,0,0,.35);
}

/* pills de categorías con efecto “glass” */
.cat-pills{
  margin-top: 6px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  background: rgba(255,255,255,.14);
  padding: 6px;
  border-radius: 14px;
  display: inline-flex;
  border: 1px solid rgba(255,255,255,.28);
}
.cat-pills .nav-link{
  color:#fff;
  font-weight:700;
}
.cat-pills .nav-link.active,
.cat-pills .nav-link:hover{
  background:#0d6efd;
  color:#fff;
  box-shadow: 0 6px 22px rgba(13,110,253,.35);
}
:root.dark .cat-pills{
  background: rgba(15,23,42,.28);
  border-color: rgba(255,255,255,.18);
}

/* transición suave al contenido */
.masthead-divider{
  height: 18px;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, var(--nk-bg) 100%);
  position: relative;
  z-index: 1;
  margin-top: -2px;
}
:root.dark .masthead-divider{
  background: linear-gradient(180deg, rgba(255,255,255,0) 0%, #0f172a 100%);
}

/* =========================================================
   Secciones de noticia (ver.php) y contenido general
   ========================================================= */
.hero-header{
  background: radial-gradient(110% 140% at 0% 0%, #2b71ff 0%, #0d4aad 60%);
  color:#fff;
  padding:28px 22px;
  border-radius: var(--nk-radius);
  margin-bottom: 22px;
  box-shadow: var(--nk-shadow);
}
.hero-header h1{
  font-size: clamp(1.7rem, 2.5vw, 2.4rem);
  margin: 0 0 8px 0;
  line-height:1.2;
  font-weight:800;
  letter-spacing: -0.3px;
}
.hero-meta{ opacity:.95; font-size:.95rem; }
.badge-cat{
  background: rgba(255,255,255,.18);
  color:#fff;
  border:1px solid rgba(255,255,255,.25);
  padding:.25rem .65rem;
  border-radius:999px;
  margin-left:.4rem;
  font-weight:600;
}
:root.dark .badge-cat{
  background-color: #1e293b !important;
  color: var(--nk-text) !important;
}

.noticia-img{
  width:100%;
  height:auto;
  border-radius: 14px;
  margin: 18px 0 12px;
  box-shadow: var(--nk-shadow);
  object-fit: cover;
  object-position: center;
}
.contenido{
  background: var(--nk-surface);
  border-radius: var(--nk-radius);
  padding: 20px 22px;
  box-shadow: var(--nk-shadow);
  border: 1px solid var(--nk-border);
}
:root.dark .contenido{ border-color:#1f2937; }
.contenido p{ font-size:1.06rem; line-height:1.78; }
.contenido img{
  max-width:100%;
  height:auto;
  border-radius: 12px;
  margin: 20px auto;
  display:block;
  box-shadow: var(--nk-shadow-soft);
  object-fit: cover;
  object-position: center;
}
.contenido iframe{
  max-width:100%;
  margin: 20px auto;
  display:block;
  border-radius:12px;
  box-shadow: var(--nk-shadow-soft);
}

/* =========================================================
   Chips / Etiquetas
   ========================================================= */
.etiquetas a{
  display:inline-block;
  background: var(--nk-chip);
  padding:7px 12px;
  border-radius:999px;
  margin:0 6px 8px 0;
  font-size:.86rem;
  text-decoration:none;
  font-weight:600;
  transition: all .18s ease;
  border:1px solid var(--nk-border);
  color:#374151;
}
.etiquetas a:hover{
  background:var(--nk-chip-hover);
  transform: translateY(-1px);
}

/* =========================================================
   Cards / Listas (index y relacionadas)
   ========================================================= */
.card{
  border: 1px solid var(--nk-border);
  border-radius: 16px;
  box-shadow: var(--nk-shadow-soft);
  background: var(--nk-surface);
}
.news-card{
  transition: transform .18s ease, box-shadow .18s ease;
}
.news-card:hover{
  transform: translateY(-3px);
  box-shadow: var(--nk-shadow);
}
.news-card img{
  border-top-left-radius: 16px !important;
  border-top-right-radius: 16px !important;
}

/* “line-clamp” utilidades */
.line-clamp-1,
.truncate-1{
  display:-webkit-box;
  -webkit-line-clamp:1;
  line-clamp:1;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.line-clamp-2,
.truncate-2{
  display:-webkit-box;
  -webkit-line-clamp:2;
  line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.line-clamp-3,
.truncate-3{
  display:-webkit-box;
  -webkit-line-clamp:3;
  line-clamp:3;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

/* =========================================================
   Tabs/Pills (sidebar: Últimas / Destacadas / Populares)
   ========================================================= */
.tabs-section{
  background: var(--nk-surface);
  border: 1px solid var(--nk-border);
  border-radius: var(--nk-radius);
  box-shadow: var(--nk-shadow-soft);
}

/* 3 pestañas en una fila, sin corte de texto */
.nk-tabs-3{
  --nk-tabs-pad-y: .45rem;
  --nk-tabs-pad-x: .5rem;
}
.nk-tabs-3 .nav-item{ width:33.3333%; } /* fuerza 3 iguales */
.nk-tabs-3 .nav-link{
  font-weight: 800;
  letter-spacing:.1px;
  white-space: nowrap;
  padding: var(--nk-tabs-pad-y) var(--nk-tabs-pad-x);
  font-size: .92rem;          /* un toque más chico para que entre "Populares" */
  border-radius: .65rem !important;
}
.nk-tabs-3 .nav-link.active{
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.4);
}
@media (max-width: 380px){
  .nk-tabs-3 .nav-link{ font-size: .85rem; }
}

/* =========================================================
   Slider de noticias destacadas (col izquierda) - overlay
   ========================================================= */
.nk-slide{ position: relative; border-radius: 16px; overflow: hidden; }
.nk-slide img{ display:block; height:300px; object-fit:cover; object-position:center; width:100%; }
.nk-slide::after{ content:""; position:absolute; inset:0; background: var(--nk-overlay-grad); }
.nk-slide-caption{
  position: absolute; left:0; right:0; bottom:0; padding: 24px 18px;
  color:#fff; z-index:2;
}
.nk-slide-caption h5{
  margin:0;
  font-size: clamp(1.05rem, 1.8vw, 1.35rem);
  font-weight:800;
  letter-spacing:-.2px;
  text-shadow: 0 2px 12px rgba(0,0,0,.35);
}

/* =========================================================
   Radio player — botón centrado con aro
   ========================================================= */
.radio-card-pro{
  background: linear-gradient(135deg, #0d6efd 0%, #5b9dff 100%);
  color:#fff;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.2);
}
:root.dark .radio-card-pro{
  background: linear-gradient(135deg, #0b2a66 0%, #0d4aad 100%);
  border-color: rgba(255,255,255,.15);
}
.radio-card-pro .form-range{ accent-color:#fff; }

/* Aro azul atrás del botón */
.radio-circle{
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: radial-gradient(100% 100% at 50% 50%, rgba(255,255,255,.16) 0%, rgba(255,255,255,.06) 100%);
  border: 2px solid rgba(255,255,255,.45);
  box-shadow: 0 6px 22px rgba(0,0,0,.25), inset 0 0 12px rgba(255,255,255,.12);
  display: grid;
  place-items: center;
  flex: 0 0 64px;
}
.radio-circle::after{
  content:"";
  position:absolute; inset:-6px;
  border-radius:50%;
  border: 4px solid rgba(255,255,255,.15);
  pointer-events:none;
}

/* Botón interior centrado */
.radio-btn-play{
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 0;
  background: #ffffff;
  color: #0d6efd;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.radio-btn-play:hover{
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(0,0,0,.28);
}
.radio-btn-play:active{ transform: translateY(0); }

/* Ícono play/pause centrado */
.radio-btn-play i{
  display:inline-block;
  transform: translateX(1px); /* leve empuje para balancear el triángulo */
}

/* Dot de “vivo” */
.live-dot{
  width:10px;height:10px;border-radius:50%;
  background:#ff5b5b; display:inline-block;
  box-shadow:0 0 0 6px rgba(255,91,91,.25);
  animation:pulse 1.6s infinite;
}
@keyframes pulse{
  0%{ box-shadow:0 0 0 0 rgba(255,91,91,.45); }
  70%{ box-shadow:0 0 0 10px rgba(255,91,91,0); }
  100%{ box-shadow:0 0 0 0 rgba(255,91,91,0); }
}

/* =========================================================
   Compartir
   ========================================================= */
.share-row .btn{ border-radius: 999px; font-weight:700; }

/* =========================================================
   Barra de progreso de lectura (ver.php)
   ========================================================= */
.read-progress{
  position:fixed; top:0; left:0; height:4px; width:0%;
  background: linear-gradient(90deg, var(--nk-primary) 0%, #6ea8fe 100%);
  z-index: 9999; box-shadow: 0 2px 10px rgba(13,110,253,.35);
}

/* =========================================================
   Modo oscuro: contraste de títulos y textos
   ========================================================= */
:root.dark h1,
:root.dark h2,
:root.dark h3,
:root.dark h4,
:root.dark h5,
:root.dark h6,
:root.dark .card-title,
:root.dark .news-card .card-title a{
  color: var(--nk-text) !important;
}
:root.dark .news-card .card-text,
:root.dark .small-muted{
  color: var(--nk-muted) !important;
}

/* Comentarios legibles en dark */
.comentario-card{
  border:1px solid var(--nk-border);
  border-radius: var(--nk-radius);
  box-shadow: var(--nk-shadow-soft);
  background: var(--nk-surface);
}
:root.dark .comentario-card .card-title,
:root.dark .comentario-card .form-label{
  color: var(--nk-text) !important;
}
:root.dark .comentario-card .form-control{
  background-color: #0f172a;
  color: var(--nk-text) !important;
  border-color: #334155;
}
:root.dark .comentario-card .form-control::placeholder{
  color: #94a3b8 !important;
}
:root.dark .comentario-card .btn-primary{
  background-color: var(--nk-primary);
  border-color: var(--nk-primary);
}

/* =========================================================
   Utilidades y fixes
   ========================================================= */
:root.dark .text-dark{ color: var(--nk-text) !important; }
:root.dark .text-muted{ color: #cbd5e1 !important; }

/* =========================================================
   Slider de Anuncios (altura estable)
   ========================================================= */
#sliderAnuncios .carousel,
#sliderAnuncios .carousel-inner,
#sliderAnuncios .carousel-item{
  height: var(--ads-h);
}
#sliderAnuncios .carousel-item{
  background: var(--nk-bg);
}
:root.dark #sliderAnuncios .carousel-item{
  background:#0f172a;
}
#sliderAnuncios img,
#sliderAnuncios video{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
  object-position:center;
  border-radius: 12px;
}

/* Responsive tweaks */
@media (max-width: 576px){
  :root{ --masthead-h: 300px; --ads-h: 200px; }
  .contenido{ padding: 16px; }
  .nk-slide img{ height:220px; }
}
@media (min-width: 577px) and (max-width: 991.98px){
  :root{ --masthead-h: 380px; --ads-h: 210px; }
}
@media (min-width: 992px){
  :root{ --masthead-h: 420px; --ads-h: 220px; }
}

/* =========================================================
   Botón Modo Oscuro - más notorio
   ========================================================= */
.btn-darkmode {
  background-color: rgba(0, 0, 0, 0.6);
  color: #fff !important;
  border-radius: 50%;
  padding: 10px;
  border: 2px solid #fff;
  font-size: 1.2rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  transition: all 0.3s ease;
  position: relative;
  z-index: 1000; /* por encima de imágenes */
  width: 44px; height: 44px; display:flex; align-items:center; justify-content:center;
}
.btn-darkmode:hover {
  background-color: #ffc107;
  color: #000 !important;
  border-color: #000;
}

/* =========================================================
   FOOTER moderno (sirve para .footer-main y .footer-modern)
   ========================================================= */
.footer-modern,
.footer-main {
  background: linear-gradient(135deg, #0d0d0d, #1a1a1a);
  border-top: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  transition: background 0.4s ease, color 0.3s ease;
}
.footer-modern .footer-link,
.footer-main .footer-link {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-modern .footer-link:hover,
.footer-main .footer-link:hover { color: #fff; }
.footer-modern .footer-social,
.footer-main .footer-social {
  color: rgba(255,255,255,0.75);
  font-size: 1.3rem;
  transition: color 0.2s, transform 0.2s;
}
.footer-modern .footer-social:hover,
.footer-main .footer-social:hover {
  color: #0d6efd;
  transform: scale(1.15);
}
.footer-bottom {
  background: rgba(0,0,0,0.2);
  font-size: 0.85rem;
}
.dark .footer-modern,
.dark .footer-main {
  background: linear-gradient(135deg, #121212, #1f1f1f);
}
.dark .footer-modern .footer-link,
.dark .footer-main .footer-link,
.dark .footer-modern .footer-social,
.dark .footer-main .footer-social {
  color: rgba(255,255,255,0.8);
}

/* =========================================================
   LEGIBILIDAD PÁGINAS LEGALES / CONTACTO (DARK & LIGHT)
   (colores altos dentro de .card para textos, labels, links y inputs)
   ========================================================= */

/* Texto principal dentro de cards: siempre alto contraste */
.card p,
.card li,
.card h5,
.card h6,
.card .form-label,
.card label {
  color: var(--nk-text) !important;
  opacity: .98;
}

/* Enlaces dentro de cards: visibles y con subrayado */
.card a {
  color: var(--nk-primary);
  text-decoration: underline;
}
:root.dark .card a {
  color: #93c5fd;
  text-decoration: underline;
}

/* “muted” dentro de cards: subir contraste en dark */
:root.dark .card .text-muted,
:root.dark .card .small-muted {
  color: var(--nk-muted) !important;
  opacity: .95;
}

/* Campos de formulario dentro de cards (contacto, etc.) */
:root.dark .card .form-control,
:root.dark .card .form-select,
:root.dark .form-card .form-control,
:root.dark .form-card .form-select {
  background-color: #0f172a;
  color: var(--nk-text) !important;
  border-color: #334155;
}
:root.dark .card .form-control::placeholder,
:root.dark .form-card .form-control::placeholder {
  color: #94a3b8 !important;
}

/* Botones dentro de cards: mantener color primario en dark */
:root.dark .card .btn-primary,
:root.dark .form-card .btn-primary {
  background-color: var(--nk-primary);
  border-color: var(--nk-primary);
}

/* Tablas/listas dentro de cards: heredar buen contraste */
:root.dark .card .table,
:root.dark .card .list-group-item {
  color: var(--nk-text) !important;
}
