:root{
  --pn-blue:#1b63c6;
  --pn-blue2:#0f3f86;
  --pn-lime:#b7d400;
  --pn-green:#49b36b;

  --bg:#e9f0fb;
  --card:#ffffff;
  --text:#0f172a;
  --muted:#64748b;
  --line:rgba(15,23,42,.12);
  --radius:16px;
  --shadow:0 10px 30px rgba(0,0,0,.12);
}

*{box-sizing:border-box}
body{margin:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial;background:var(--bg);color:var(--text)}
a{color:inherit;text-decoration:none}
img{max-width:100%;display:block}

.container{max-width:1200px;margin:0 auto;padding:16px}

/* =========================
   HEADER
========================= */

.topbar{
  position: relative;
  color:#fff;
  border-bottom:1px solid rgba(255,255,255,.15);
  overflow-x: visible;
  overflow-y: hidden;

  /* Azul con “halo” claro a la izquierda + caída a azul profundo */
  background:
    radial-gradient(900px 260px at 140px 45px,
      rgba(255,255,255,.26) 0%,
      rgba(255,255,255,.10) 35%,
      rgba(255,255,255,0) 70%
    ),
    linear-gradient(90deg,
      #2a7de0 0%,
      #1b63c6 45%,
      #0f3f86 100%
    );
  padding: 10px 0;
}

.topbar::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:
    radial-gradient(520px 220px at 120px 50%,
      rgba(255,255,255,.16),
      rgba(255,255,255,0) 70%
    );
}

.topbar-inner{
  position: relative;
  display:flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align:center;
}

.brand{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px;
}

.brand-logo{
  width: 92px;
  height: 92px;
  background: transparent;
  display:grid;
  place-items:center;
}

.logo-badge{
  background: transparent;
  box-shadow: none;
  border: none;
  padding: 0;
  border-radius: 0;
}

.brand-logo img{
  width: 92px;
  height: 92px;
  object-fit: contain;
}

@media (min-width: 900px){
  .brand-logo{ width: 84px; height: 84px; }
  .brand-logo img{ width: 84px; height: 84px; }
}

.brand h1{margin:0;font-size:18px;line-height:1.1}
.brand small{display:block;opacity:.85;margin-top:2px}

/* Socialbar (header) */
.socialbar{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding:6px 10px;
  border-radius:999px;
  background: rgba(255,255,255,.10);
  backdrop-filter: blur(6px);
}

.social-link{
  display:inline-flex;
  width:30px;height:30px;
  align-items:center;justify-content:center;
  border-radius:999px;
}
.social-link svg{ width:18px;height:18px; fill:#fff; opacity:.95; }
.social-link:hover svg{ opacity:1; transform: translateY(-1px); }



/* =========================
   HERO (full-bleed pero centrado)
========================= */

.hero{
  background:linear-gradient(180deg, rgba(183,212,0,.18), rgba(73,179,107,.10));
  border-bottom:1px solid var(--line);

  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);

  padding: 16px;
}

/* Asegura que el contenido del hero quede centrado */
.hero-grid{
  max-width: 1200px;
  margin: 0 auto;
  display:grid;
  grid-template-columns: 1fr;
  gap:14px;
}
@media (min-width:900px){
  .hero-grid{ grid-template-columns: 2fr 1fr; }
}

/* =========================
   CARDS / COMPONENTS
========================= */

.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}
.card-pad{padding:14px}

.carousel{
  position:relative;
  overflow:visible;
  border-radius:var(--radius);
  border:1px solid var(--line);
  background:transparent;
}

/* cada slide como "tarjeta" */
.pn-slide{ display:block; }

.pn-slide-media{
  border-radius:var(--radius);
  overflow:hidden;
  background:#000;
  border:1px solid var(--line);
}

.pn-slide-media img{
  width:100%;
  height:320px;
  object-fit:cover;
  opacity:.95;
}

/* Mobile: evitar recortes */
@media (max-width: 700px){
  .pn-slide-media img{
    height: auto !important;
    aspect-ratio: 16/9;
    width: 100%;
    object-fit: contain;
    background:#000;
  }
}

.pn-slide-caption{
  margin-top:10px;
  background:rgba(15,23,42,.88);
  color:#fff;
  padding:10px 12px;
  border-radius:14px;
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:center;
}

.pn-slide-title{
  font-size:14px;
  font-weight:900;
  line-height:1.2;
}

.pn-slide-cta{
  font-size:12px;
  font-weight:900;
  padding:8px 12px;
  border-radius:999px;
  background:rgba(183,212,0,.22);
  border:1px solid rgba(183,212,0,.55);
  color:#fff;
  white-space:nowrap;
}

/* dots */
.carousel .dots{
  position:absolute;
  top:12px;
  right:12px;
  display:flex;
  gap:6px;
  z-index:5;
}
.carousel .dot{
  width:10px;
  height:10px;
  border-radius:999px;
  background:rgba(255,255,255,.35);
  border:1px solid rgba(255,255,255,.35)
}
.carousel .dot.active{
  background:var(--pn-lime);
  border-color:var(--pn-lime)
}
.carousel .cap{ display:none; }

.layout{
  max-width: 1200px;
  margin: 0 auto;
  display:grid;
  grid-template-columns: 1fr;
  gap:14px;
  padding:16px 16px;
}
@media(min-width:900px){
  .layout{grid-template-columns: 2fr 1fr;}
}

.section-title{
  margin:0 0 10px;
  font-size:18px;
  padding-left:6px;
  border-left:6px solid var(--pn-lime);
}

.cat-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap:12px;
}
@media(min-width:700px){
  .cat-grid{grid-template-columns: 1fr 1fr;}
}

.cat-card{ padding:12px; }
.cat-head{
  display:flex;justify-content:space-between;align-items:center;gap:10px;
  margin-bottom:10px;
}
.cat-name{ font-weight:900; font-size:16px; }
.cat-link{
  font-size:12px;
  color:var(--pn-blue2);
  background:rgba(27,99,198,.10);
  border:1px solid var(--line);
  padding:6px 10px;border-radius:999px;
}

.posts-list{display:grid;gap:8px}
.post-item{
  display:flex;gap:10px;align-items:flex-start;
  padding:10px;border-radius:14px;border:1px solid var(--line);
  background:linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,255,255,.75));
}
.thumb{
  width:64px;height:48px;border-radius:12px;border:1px solid var(--line);
  background:rgba(15,23,42,.06);
  overflow:hidden;flex:0 0 auto;
}
.thumb img{width:100%;height:100%;object-fit:cover}
.post-item h4{margin:0;font-size:14px;line-height:1.25}
.post-meta{font-size:12px;color:var(--muted);margin-top:2px}

.sidebar .post-item{padding:10px}

.badge{
  display:inline-flex;align-items:center;gap:6px;
  font-size:12px;color:#0f172a;
  background:rgba(183,212,0,.22);
  border:1px solid rgba(183,212,0,.55);
  padding:6px 10px;border-radius:999px;
}

/* Sidebar Últimas noticias con scroll interno */
.sidebar-latest{
  max-height: 450px;
  overflow: hidden;
  display:flex;
  flex-direction:column;
}
.sidebar-latest .posts-list{
  overflow:auto;
  padding-right:6px;
}
.sidebar-latest .posts-list::-webkit-scrollbar{ width:10px; }
.sidebar-latest .posts-list::-webkit-scrollbar-thumb{
  background: rgba(15,23,42,.18);
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,.6);
}

/* Article */
.article{ padding:16px; }
.article h1{margin:0 0 6px;font-size:26px}
.article .meta{color:var(--muted);font-size:13px;margin-bottom:12px}
.article .feat{
  border-radius:18px;overflow:hidden;border:1px solid var(--line);
  margin:12px 0;
}
.article .content{line-height:1.7;font-size:16px}

.post-footer{
  margin-top:16px;
  padding-top:14px;
  border-top:1px solid var(--line);
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}
.post-footer-label{
  font-size:12px;
  font-weight:900;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.06em;
}
.post-footer-author{
  font-size:14px;
  font-weight:800;
  color:var(--text);
  background:rgba(27,99,198,.08);
  border:1px solid var(--line);
  padding:8px 12px;
  border-radius:999px;
}

/* Excel table image */
.ql-editor img.excel-table-img{
  max-width: 100%;
  height: auto;
  display: block;
  margin: 10px auto;
}
.excel-table-wrap{ margin: 12px auto; }
.excel-table-wrap.size-s{ max-width: 520px; }
.excel-table-wrap.size-m{ max-width: 720px; }
.excel-table-wrap.size-l{ max-width: 920px; }
.excel-table-img{ width: 100%; height: auto; display: block; }

/* =========================
   ADS + BACKGROUND (desktop)
========================= */

.page-shell{ display:block; }

@media (min-width: 1100px){
  body.has-bg{
    background-image: var(--bg-url);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
  }

  .page-shell{
    display:grid;
    gap:16px;
    justify-content:center;
    align-items:start;
    padding: 16px 0;
  }

  body.has-ad-left.has-ad-right .page-shell{
    grid-template-columns: 170px minmax(900px, 1200px) 170px;
  }
  body.has-ad-left:not(.has-ad-right) .page-shell{
    grid-template-columns: 170px minmax(900px, 1200px);
  }
  body.has-ad-right:not(.has-ad-left) .page-shell{
    grid-template-columns: minmax(900px, 1200px) 170px;
  }
  body:not(.has-ad-left):not(.has-ad-right) .page-shell{
    grid-template-columns: minmax(900px, 1200px);
  }

  .page-main{ min-width: 0; }

  .ad-slot{
    position: sticky;
    top: 90px;
    height: 600px;
    border-radius: 14px;
    overflow:hidden;
    border:1px solid var(--line);
    background: rgba(255,255,255,.35);
  }
  .ad-slot img{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
  }
}
@media (max-width: 1099px){
  .page-shell{ display:block; }
  .ad-slot{ display:none; }
  body.has-bg{ background-image:none; }
}

/* Ocultar slots vacíos */
.ad-slot:empty,
.ad-slot.no-ad{
  display:none !important;
}

/* =========================
   FOOTER
========================= */

.footer{
  margin-top:18px;
  padding:18px 0;
  color:#fff;
  background:linear-gradient(90deg,var(--pn-blue2),var(--pn-blue));
}

.footer-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  flex-wrap:wrap;
}
.footer-copy{ display:flex; flex-direction:column; gap:4px; }
.footer-tagline{ opacity:.85; font-size:13px; }

.footer-social{ display:flex; flex-direction:column; gap:8px; align-items:flex-end; }
.footer-social-title{ font-size:12px; font-weight:900; opacity:.9; letter-spacing:.02em; }

.socialbar--footer{ background: rgba(255,255,255,.10); }

@media (max-width: 700px){
  .footer-inner{ justify-content:center; text-align:center; }
  .footer-social{ align-items:center; }
}

/* ===== LIVE PILL BUTTON (header) ===== */
.live-pill{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:10px 14px;
  border:0;
  border-radius:999px;
  background: var(--pn-green, #49b36b);
  color:#fff;
  cursor:pointer;
  box-shadow: 0 10px 24px rgba(0,0,0,.18);
  user-select:none;
  white-space:nowrap;
}

.live-pill:hover{ filter: brightness(1.05); transform: translateY(-1px); }
.live-pill:active{ transform: translateY(0); }

.live-pill-ico{
  width:34px; height:34px;
  display:grid; place-items:center;
  border-radius:999px;
  background: rgba(255,255,255,.16);
  border: 2px solid rgba(255,255,255,.45);
}
.live-pill-ico svg{ width:18px; height:18px; fill:#fff; }

.live-pill-text{
  font-weight:900;
  letter-spacing:.08em;
  font-size:14px;
}

/* En pantallas pequeñas, que no estorbe */
@media (max-width: 720px){
  .live-pill-text{ display:none; }
  .live-pill{ padding:10px; }
}

/* ===== SWEETALERT LIVE MODAL ===== */
/* Popup sin fondo (porque ahora la imagen es <img>) */
.pn-live-popup{
  padding: 0;
  border-radius: 20px;
  overflow: hidden;
  max-width: 520px;
  background: rgba(0,0,0,.85);
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 24px 60px rgba(0,0,0,.45);
}

/* layout */
.pn-live-fullimg{ display:grid; gap:0; }
.pn-live-media{ position:relative; }
.pn-live-img{
  width:100%;
  height:auto;     /* ✅ no recorta */
  display:block;   /* ✅ sin espacios raros */
}

/* X sobre la imagen (opcional) */
.pn-live-x{
  position:absolute;
  top:10px; right:12px;
  width:38px; height:38px;
  border-radius:999px;
  border:0;
  cursor:pointer;
  font-size:26px;
  line-height:38px;
  color:#fff;
  background: rgba(0,0,0,.45);
}
.pn-live-x:hover{ background: rgba(0,0,0,.6); }

/* panel inferior: aquí “bajamos” el reproductor */
.pn-live-panel{
  padding: 14px 16px 16px;
  display:grid;
  gap:12px;
}

.pn-live-head{ text-align:center; display:grid; gap:6px; }
.pn-live-badge{
  justify-self:center;
  padding:6px 10px;
  border-radius:999px;
  background: rgba(73,179,107,.9);
  font-weight:800;
  letter-spacing:.08em;
  font-size:12px;
}
.pn-live-title{ font-size:18px; font-weight:900; color:#fff; }
.pn-live-sub{ opacity:.9; font-size:13px; color:#fff; }

.pn-live-audio{ width:100%; border-radius:12px; }
.pn-live-hint{ font-size:12px; opacity:.85; color:#fff; text-align:center; }

/* ===== LIVE MODAL: ajustes móviles ===== */
@media (max-width: 520px){
  .pn-live-popup{
    max-width: 92vw;           /* más pequeño */
    border-radius: 16px;
  }

  /* La imagen no ocupa toda la pantalla: la recortamos “bonito” */
  .pn-live-img{
    max-height: 42vh;          /* ajusta: 38–48vh */
    width: 100%;
    object-fit: cover;         /* recorta un poco, sin deformar */
    object-position: center;   /* centra el recorte */
  }

  .pn-live-panel{
    padding: 12px 12px 14px;
    gap: 10px;
  }

  .pn-live-title{ font-size: 16px; }
  .pn-live-sub{ font-size: 12px; }
}




/* =========================
   FIX DEFINITIVO HEADER (3 filas)
   Logo / Redes+Radio / Categorías (scroll)
========================= */

/* 1) Estructura en 3 filas */
header.topbar .topbar-inner{
  display:flex !important;
  flex-direction:column !important;
  align-items:center !important;
  gap:10px !important;
  text-align:center !important;
}

/* 2) Redes + botón en vivo: en una sola línea y centrado */
header.topbar .topbar-right,
header.topbar .topbar-actions{
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  gap:12px !important;
  flex-wrap:wrap !important;
  width:auto !important;
}




.listen-card{ cursor:pointer; }
.listen-card:hover{ transform: translateY(-1px); }
.listen-card:active{ transform: translateY(0); }
.listen-card:focus{ outline: 2px solid rgba(183,212,0,.6); outline-offset: 3px; }


 .pn-float {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 9999;
    display: none;
  }
  .pn-float.is-on { display: block; }

  .pn-float-btn{
    width: 58px;
    height: 58px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(11,18,32,.92);
    box-shadow: 0 10px 30px rgba(0,0,0,.35);
    cursor:pointer;
    user-select:none;
    overflow:hidden;
    position: relative;
    padding:0;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  .pn-float-btn img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    display:block;
  }

  .pn-float-ico{
    position:absolute;
    inset:0;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size: 22px;
    font-weight: 900;
    color:#fff;
    text-shadow: 0 2px 10px rgba(0,0,0,.65);
    background: rgba(0,0,0,.15);
  }

  .pn-audio-hidden{
    position: fixed;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
  }

  .pn-live-min {
    position:absolute;
    right: 44px;
    top: 10px;
    width:34px;height:34px;
    border-radius:10px;
    border:0;
    background: rgba(0,0,0,.45);
    color:#fff;
    cursor:pointer;
    font-size:18px;
    line-height:34px;
  }
  
  /* Animación “respirar” cuando suena */
  @keyframes pnPulse {
    0%   { transform: scale(1);   box-shadow: 0 10px 30px rgba(0,0,0,.35); }
    50%  { transform: scale(1.06); box-shadow: 0 14px 40px rgba(0,0,0,.45); }
    100% { transform: scale(1);   box-shadow: 0 10px 30px rgba(0,0,0,.35); }
  }

  /* Se activa por clase */
  .pn-float.is-playing .pn-float-btn{
    animation: pnPulse 1.4s ease-in-out infinite;
  }

  /* (Opcional) un aro suave alrededor */
  .pn-float.is-playing .pn-float-btn::after{
    content:"";
    position:absolute;
    inset:-6px;
    border-radius:999px;
    border: 2px solid rgba(255,255,255,.18);
    pointer-events:none;
  }
  
 /* ===== NAV CATEGORÍAS (ÚNICO / LIMPIO) ===== */
.topbar{ overflow-x: visible; overflow-y: hidden; }

.topbar > .nav{
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;

  display: flex;
  flex-wrap: nowrap;
  gap: 10px;

  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;

  white-space: nowrap;
  justify-content: flex-start;

  padding: 2px 16px 10px;
  scrollbar-width: thin; /* Firefox */
}

.topbar > .nav a{
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.10);
}
.topbar > .nav a:hover{
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.18);
}

/* scrollbar visible en escritorio */
@media (min-width: 821px){
  .topbar > .nav::-webkit-scrollbar{ height: 8px; }
  .topbar > .nav::-webkit-scrollbar-thumb{
    background: rgba(255,255,255,.25);
    border-radius: 999px;
  }
}

/* en móvil la ocultamos (opcional) */
@media (max-width: 820px){
  .topbar > .nav::-webkit-scrollbar{ display:none; }
  .topbar > .nav{ scrollbar-width: none; }
}

/* Bloquear selección de texto (UX) */
body{
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}
input, textarea, [contenteditable="true"]{
  -webkit-user-select: text;
  -moz-user-select: text;
  user-select: text;
}

/* Bloquear arrastre de imágenes sin matar clicks */
img{ -webkit-user-drag: none; user-drag: none; }

.app-card{ cursor:pointer; text-decoration:none; }
.app-card:hover{ transform: translateY(-2px); box-shadow: var(--shadow); }
.app-card{ transition: transform .15s ease, box-shadow .15s ease; }

.pn-gallery{ margin-top:18px; }
.pn-gallery-title{
  font-weight:800;
  margin:10px 0 10px;
  color: var(--text);
}
.pn-gallery-grid{
  display:grid;
  grid-template-columns:repeat(6, 1fr);
  gap:10px;
}
.pn-thumb{
  padding:0;border:0;background:transparent;cursor:pointer;
  border-radius:12px; overflow:hidden;
  border:1px solid rgba(15,23,42,.12);
}
.pn-thumb img{ width:100%; height:90px; object-fit:cover; display:block; }

@media (max-width: 1100px){
  .pn-gallery-grid{ grid-template-columns:repeat(4, 1fr); }
}
@media (max-width: 700px){
  .pn-gallery-grid{ grid-template-columns:repeat(3, 1fr); }
  .pn-thumb img{ height:105px; }
}