
/* ══════════════════════════════════════════════
   AISLAMIENTO DEL TEMA DE WORDPRESS
   Todo el componente vive dentro de #pntc-root.
   Los !important bloquean sobreescrituras del tema.
   ══════════════════════════════════════════════ */

/* Reset completo del contenedor raíz */
#pntc-root {
  all: initial;
  display: block;
  font-family: var(--font-body) !important;
  font-size: 15px !important;
  line-height: 1.6 !important;
  color: #0d1a2e !important;
  box-sizing: border-box !important;
  -webkit-font-smoothing: antialiased;
}
#pntc-root *, #pntc-root *::before, #pntc-root *::after {
  box-sizing: border-box !important;
  margin: 0;
  padding: 0;
}

/* Botones — neutralizar text-transform, letter-spacing, font del tema */
#pntc-root button,
#pntc-root .btn,
#pntc-root .chip,
#pntc-root .pg-btn,
#pntc-root .pdf-tb-btn,
#pntc-root .pdf-close,
#pntc-root .view-btn {
  text-transform: none !important;
  letter-spacing: normal !important;
  font-family: var(--font-body) !important;
  line-height: 1 !important;
  border-radius: inherit;
  -webkit-appearance: none;
  appearance: none;
}

/* Enlaces — neutralizar color/underline del tema */
#pntc-root a,
#pntc-root a:visited,
#pntc-root a:hover {
  text-decoration: none !important;
  color: inherit !important;
}
#pntc-root a.btn,
#pntc-root a.featured-pill,
#pntc-root .pdf-tb-btn[href] {
  display: inline-flex !important;
}

/* Inputs y selects
   OJO: aquí NO va font-size. Antes había 'font-size: inherit !important' y ese
   !important pisaba el tamaño propio de cada control (.year-more 12.5px,
   .sort-select 13px, #search-input 14px), que se declaran sin !important.
   Resultado: selects e input crecían a los 15px del contenedor y rompían la
   alineación con los chips. Cada control fija su tamaño más abajo. */
#pntc-root input,
#pntc-root select {
  font-family: var(--font-body) !important;
  -webkit-appearance: none;
  appearance: none;
}

/* Headings — el tema suele poner font-weight/color en h1..h6 */
#pntc-root h1 {
  font-family: var(--font-display) !important;
  font-weight: 700 !important;
  line-height: 1.1 !important;
  color: #fff !important;
  margin: 0 !important;
}

/* Párrafos */
#pntc-root p { margin: 0 !important; }

/* Imágenes — evitar max-width:100% del tema que rompe el canvas */
#pntc-root canvas { max-width: none !important; display: block !important; }
#pntc-root img { max-width: 100%; height: auto; display: block; border: none; }

/* Variables CSS — deben estar en :root para que hereden correctamente */
:root {
  /* Azul primario PNTC #002662 y derivados */
  --blue-900: #002662;
  --blue-800: #003080;
  --blue-700: #003d9e;
  --blue-600: #0a52c4;
  --blue-400: #3b7ee0;
  --blue-200: #a8c4f5;
  --blue-100: #d0e2fb;
  --blue-50:  #eaf1fd;

  /* Cian complementario */
  --cyan-600: #0077a8;
  --cyan-100: #cceef9;
  --cyan-50:  #e8f7fd;

  /* Dorado / acento cálido */
  --gold-600: #8c6200;
  --gold-100: #fef0c0;
  --gold-50:  #fffae8;

  /* Verdes (acción climática) */
  --green-700: #1a5c38;
  --green-50:  #e8f5ee;
  --green-100: #c8ead8;

  /* Morado (mitigación) */
  --purple-700: #3d2fa0;
  --purple-50:  #eeecfd;

  /* Naranja (adaptación) */
  --orange-700: #7a4b05;
  --orange-50:  #fff4e0;

  /* Neutros fríos base azul */
  --n900: #0d1a2e;
  --n700: #2c3a52;
  --n500: #6175a0;
  --n300: #b3bfd6;
  --n200: #d4dcea;
  --n100: #e8edf5;
  --n50:  #f3f6fb;

  /* Tipografía — se encola desde pntc-publicaciones.php.
     Cambiar aquí y allá a la vez si se cambia de familia. */
  --font-stack:   'Inter', Montserrat, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: var(--font-stack);
  --font-body:    var(--font-stack);
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 22px;
}

/* HERO */
#pntc-root .pub-hero {
  background: var(--blue-900);
  padding: 3rem 2rem 2.5rem;
  position: relative;
  overflow: hidden;
}

#pntc-root .pub-hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 55% 90% at 95% 40%, rgba(10,82,196,0.4) 0%, transparent 65%),
    radial-gradient(ellipse 40% 60% at -5% 90%, rgba(0,119,168,0.22) 0%, transparent 55%);
  pointer-events: none;
}

#pntc-root .pub-hero::after {
  content: '';
  position: absolute; bottom: -1px; left: 0; right: 0;
  height: 40px;
  background: var(--n50);
  clip-path: ellipse(55% 100% at 50% 100%);
}

#pntc-root .pub-hero-inner { max-width: 980px; margin: 0 auto; position: relative; z-index: 1; }

#pntc-root .pub-hero-eyebrow {
  font-family: var(--font-display);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(255,255,255,0.42); margin-bottom: 0.5rem;
}

#pntc-root .pub-hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem); font-weight: 700;
  color: #fff; line-height: 1.1; margin-bottom: 0.65rem;
  letter-spacing: -0.02em;
}

#pntc-root .pub-hero-sub { font-size: 14px; color: rgba(255,255,255,0.58); font-weight: 300; max-width: 520px; }


/* MAIN */
#pntc-root .pub-main { max-width: 980px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }


/* FEATURED STRIP */
#pntc-root .featured-strip {
  display: flex; gap: 8px; margin-bottom: 1.75rem;
  overflow-x: auto; padding-bottom: 2px; scrollbar-width: none;
}

#pntc-root .featured-strip::-webkit-scrollbar { display: none; }

#pntc-root .featured-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  background: #fff; border: 1.5px solid var(--n200); border-radius: 99px;
  font-size: 12.5px; color: var(--n700); text-decoration: none;
  white-space: nowrap; transition: all .17s; flex-shrink: 0;
}

#pntc-root .featured-pill:hover { border-color: var(--blue-400); color: var(--blue-800); background: var(--blue-50); }

#pntc-root .featured-pill-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--blue-600); flex-shrink: 0; }


/* CONTROLS */
#pntc-root .controls-bar { display: flex; gap: 10px; margin-bottom: 1.25rem; flex-wrap: wrap; align-items: center; }

#pntc-root .search-wrap { position: relative; flex: 1; min-width: 200px; }

#pntc-root .search-wrap svg {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; color: var(--n500); pointer-events: none;
}

#pntc-root #search-input {
  width: 100%; padding: 9px 12px 9px 36px;
  border: 1.5px solid var(--n200); border-radius: var(--r-md);
  background: #fff; font-family: var(--font-body); font-size: 14px !important;
  color: var(--n900); transition: border-color .2s; outline: none;
}

#pntc-root #search-input::placeholder { color: var(--n500); }

#pntc-root #search-input:focus { border-color: var(--blue-400); }


#pntc-root .sort-select {
  padding: 9px 14px; border: 1.5px solid var(--n200); border-radius: var(--r-md);
  background: #fff; font-family: var(--font-body); font-size: 13px !important;
  color: var(--n700); cursor: pointer; outline: none; transition: border-color .2s;
}

#pntc-root .sort-select:focus { border-color: var(--blue-400); }


#pntc-root .view-toggle {
  display: flex; border: 1.5px solid var(--n200);
  border-radius: var(--r-md); overflow: hidden; background: #fff;
}

#pntc-root .view-btn {
  padding: 9px 12px; border: none; background: transparent;
  cursor: pointer; color: var(--n500);
  display: flex; align-items: center; transition: background .15s, color .15s;
}

#pntc-root .view-btn:first-child { border-right: 1px solid var(--n200); }

#pntc-root .view-btn.active { background: var(--blue-900); color: #fff; }

#pntc-root .view-btn svg { width: 16px; height: 16px; }


/* FILTROS */
#pntc-root .filter-section { margin-bottom: 1.5rem; }

#pntc-root .filter-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }

#pntc-root .filter-group-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--n500); min-width: 38px; margin-right: 2px;
}

#pntc-root .chip {
  padding: 5px 13px; border-radius: 99px; font-size: 12.5px; font-weight: 400;
  border: 1.5px solid var(--n200); background: #fff; color: var(--n700);
  cursor: pointer; transition: all .17s; user-select: none;
  font-family: var(--font-body); white-space: nowrap;
}

#pntc-root .chip:hover { border-color: var(--n500); color: var(--n900); }

#pntc-root .chip.on { background: var(--blue-900); border-color: var(--blue-900); color: #fff; font-weight: 500; }


/* colores activos por valor */
#pntc-root .chip[data-cat="accion climatica"].on { background: var(--green-700);  border-color: var(--green-700); }

#pntc-root .chip[data-cat="mitigacion"].on { background: var(--purple-700); border-color: var(--purple-700); }

#pntc-root .chip[data-cat="adaptacion"].on { background: var(--orange-700); border-color: var(--orange-700); }

/* Select de "Años anteriores…" — mismo lenguaje visual que los chips.
   Existe para que la fila de años no crezca sin límite con el tiempo:
   los años recientes son chips, los viejos viven aquí. */
#pntc-root .year-more {
  /* Métricas calcadas del .chip para que queden a la misma altura:
     font-size 12.5 + line-height 1 + padding 5px + borde 1.5px.
     El padding derecho deja sitio a la flecha. */
  padding: 5px 28px 5px 13px;
  border-radius: 99px;
  font-size: 12.5px !important;
  line-height: 1 !important;
  font-weight: 400;
  height: auto;
  min-height: 0;
  border: 1.5px solid var(--n200);
  background: #fff
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%236175a0' stroke-width='1.6' stroke-linecap='round'><path d='M3 5l3 3 3-3'/></svg>")
    no-repeat right 11px center / 10px 10px;
  color: var(--n700);
  cursor: pointer;
  outline: none;
  transition: all .17s;
  font-family: var(--font-body) !important;
}

#pntc-root .year-more:hover { border-color: var(--n500); color: var(--n900); }

#pntc-root .year-more:focus-visible { border-color: var(--blue-400); }

/* Cuando hay un año viejo seleccionado, el select se ve como chip activo */
#pntc-root .year-more.on {
  background-color: var(--blue-900);
  border-color: var(--blue-900);
  color: #fff;
  font-weight: 500;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23ffffff' stroke-width='1.6' stroke-linecap='round'><path d='M3 5l3 3 3-3'/></svg>");
}


/* RESULTS META */
#pntc-root .results-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; }

#pntc-root .results-count { font-size: 13px; color: var(--n500); }

#pntc-root .results-count strong { color: var(--n900); font-weight: 500; }

#pntc-root .clear-btn {
  font-size: 12.5px; color: var(--blue-600); border: none; background: none;
  cursor: pointer; font-family: var(--font-body); padding: 0; display: none;
  text-decoration: underline; text-underline-offset: 2px;
}

#pntc-root .clear-btn.visible { display: inline; }


/* GRID */
#pntc-root .pub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(256px, 1fr)); gap: 14px; }

#pntc-root .pub-grid.list-mode { grid-template-columns: 1fr; gap: 8px; }


/* CARD */
#pntc-root .card {
  background: #fff; border: 1.5px solid var(--n100); border-radius: var(--r-xl);
  overflow: hidden; display: flex; flex-direction: column;
  transition: border-color .2s, transform .2s, box-shadow .2s;
  animation: cardIn .28s ease both;
}

#pntc-root .card:hover { border-color: var(--n200); transform: translateY(-2px); box-shadow: 0 6px 24px rgba(0,38,98,0.09); }

@keyframes cardIn { from { opacity:0; transform:translateY(7px); } to { opacity:1; transform:translateY(0); } }

#pntc-root .card-cover { width: 100%; height: 148px; object-fit: cover; display: block; background: var(--n100); }

#pntc-root .card-cover-placeholder {
  width: 100%; height: 148px;
  background: var(--blue-50);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

#pntc-root .card-cover-placeholder svg { width: 36px; height: 36px; opacity: 0.22; color: var(--blue-600); }


#pntc-root .card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }

#pntc-root .card-badges { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 9px; }


/* BADGES */
#pntc-root .badge {
  display: inline-block; padding: 3px 9px; border-radius: 99px;
  font-size: 11px; font-weight: 500; letter-spacing: 0.02em;
}

#pntc-root .badge-year { background: var(--n100);     color: var(--n700); }

#pntc-root .badge-ac { background: var(--green-50);   color: var(--green-700); }

#pntc-root .badge-mit { background: var(--purple-50);  color: var(--purple-700); }

#pntc-root .badge-ada { background: var(--orange-50);  color: var(--orange-700); }

#pntc-root .badge-tipo { background: var(--n50);      color: var(--n700); border: 1px solid var(--n200); }
#pntc-root .badge-informe { background: var(--blue-50);    color: var(--blue-800); }

#pntc-root .badge-guia { background: var(--cyan-50);    color: var(--cyan-600); }

#pntc-root .badge-manual { background: var(--gold-50);    color: var(--gold-600); }


#pntc-root .card-title {
  font-family: var(--font-display);
  font-size: 13.5px; font-weight: 600; color: var(--n900);
  line-height: 1.4; margin-bottom: auto; padding-bottom: 12px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}


/* BOTONES */
#pntc-root .card-actions { display: flex; gap: 7px; margin-top: 4px; }

#pntc-root .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 7px 12px; border-radius: var(--r-md);
  font-family: var(--font-body); font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all .17s; text-decoration: none;
  border: 1.5px solid transparent; white-space: nowrap; flex: 1;
}

#pntc-root .btn svg { width: 13px; height: 13px; flex-shrink: 0; }

#pntc-root .btn-outline { border-color: var(--n200); color: var(--n700); background: transparent; }

#pntc-root .btn-outline:hover { border-color: var(--n500); color: var(--n900); background: var(--n50); }

#pntc-root .btn-primary { background: var(--blue-900); color: #fff; border-color: var(--blue-900); }

#pntc-root .btn-primary:hover { background: var(--blue-700); border-color: var(--blue-700); }


/* LIST MODE */
#pntc-root .pub-grid.list-mode .card { flex-direction: row; border-radius: var(--r-lg); }

#pntc-root .pub-grid.list-mode .card-cover, #pntc-root .pub-grid.list-mode .card-cover-placeholder { width: 110px; height: auto; min-height: 90px; flex-shrink: 0; border-radius: 0; }

#pntc-root .pub-grid.list-mode .card-body { padding: 12px 16px; flex-direction: row; align-items: center; gap: 16px; }

#pntc-root .pub-grid.list-mode .card-info { flex: 1; min-width: 0; }

#pntc-root .pub-grid.list-mode .card-title { font-size: 13px; padding-bottom: 5px; -webkit-line-clamp: 2; margin-bottom: 0; }

#pntc-root .pub-grid.list-mode .card-actions { flex-direction: column; gap: 5px; margin-top: 0; width: 116px; flex-shrink: 0; }


/* EMPTY */
#pntc-root .empty-state { grid-column: 1/-1; text-align: center; padding: 4rem 2rem; color: var(--n500); }

#pntc-root .empty-state svg { width: 48px; height: 48px; opacity: 0.22; margin-bottom: 1rem; }

#pntc-root .empty-state p { font-size: 14px; }


/* PAGINACIÓN */
#pntc-root .pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 2rem;
  flex-wrap: wrap;
}


#pntc-root .pg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--n200);
  background: #fff;
  color: var(--n700);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .17s;
  user-select: none;
  line-height: 1;
}

#pntc-root .pg-btn:hover:not(:disabled):not(.active) {
  border-color: var(--blue-400);
  color: var(--blue-800);
  background: var(--blue-50);
}

#pntc-root .pg-btn.active {
  background: var(--blue-900);
  border-color: var(--blue-900);
  color: #fff;
  cursor: default;
}

#pntc-root .pg-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

#pntc-root .pg-btn svg { width: 14px; height: 14px; }

#pntc-root .pg-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  font-size: 13px;
  color: var(--n500);
  letter-spacing: 0.05em;
}

#pntc-root .pg-info {
  text-align: center;
  font-size: 12px;
  color: var(--n500);
  margin-top: 10px;
}


/* ─── PDF VIEWER MODAL ─── */
#pntc-root .pdf-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 12, 28, 0.82);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

#pntc-root .pdf-overlay.open {
  opacity: 1;
  pointer-events: all;
}


#pntc-root .pdf-modal {
  display: flex;
  flex-direction: column;
  width: min(860px, 96vw);
  height: 92vh;
  margin-top: 3vh;
  background: #111827;
  border-radius: 16px;
  overflow: hidden;
  transform: translateY(18px) scale(0.98);
  transition: transform .25s ease;
  box-shadow: 0 32px 80px rgba(0,0,0,0.5);
}

#pntc-root .pdf-overlay.open .pdf-modal {
  transform: translateY(0) scale(1);
}


/* Toolbar */
#pntc-root .pdf-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #1a2540;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
  min-height: 52px;
}


#pntc-root .pdf-toolbar-title {
  flex: 1;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}


#pntc-root .pdf-tb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.75);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
  flex-shrink: 0;
}

#pntc-root .pdf-tb-btn:hover:not(:disabled) {
  background: rgba(255,255,255,0.14);
  color: #fff;
  border-color: rgba(255,255,255,0.25);
}

#pntc-root .pdf-tb-btn:disabled { opacity: 0.3; cursor: not-allowed; }

#pntc-root .pdf-tb-btn svg { width: 14px; height: 14px; flex-shrink: 0; }

#pntc-root .pdf-tb-btn.icon-only { padding: 6px 8px; }


#pntc-root .pdf-page-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  white-space: nowrap;
  flex-shrink: 0;
}

#pntc-root .pdf-page-indicator input {
  width: 42px;
  text-align: center;
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-family: var(--font-body);
  font-size: 12px;
  outline: none;
}

#pntc-root .pdf-page-indicator input:focus { border-color: var(--blue-400); }


#pntc-root .pdf-divider {
  width: 1px;
  height: 20px;
  background: rgba(255,255,255,0.12);
  flex-shrink: 0;
}


/* Viewer area */
#pntc-root .pdf-viewport {
  flex: 1;
  overflow-y: auto;
  overflow-x: auto;
  display: flex;
  flex-direction: column;
  align-items: center;         /* centra el PDF cuando es más angosto que el panel */
  padding: 20px 16px;
  gap: 12px;
  background: #1e293b;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}

#pntc-root .pdf-viewport::-webkit-scrollbar { width: 6px; }

#pntc-root .pdf-viewport::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }


#pntc-root .pdf-canvas-wrap {
  position: relative;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
  border-radius: 4px;
  overflow: hidden;
  line-height: 0;
  flex-shrink: 0;
  /* Sin margin auto — el centrado lo hace align-items:center del padre.
     Cuando el PDF supera el ancho, el overflow-x del padre permite scroll
     libre en ambas direcciones sin que margin:auto lo bloquee. */
}

#pntc-root .pdf-canvas-wrap canvas {
  display: block;
  max-width: none;           /* sin max-width para que el zoom no quede recortado */
}


/* Loading state */
#pntc-root .pdf-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 100%;               /* ocupa todo el ancho disponible */
  min-height: 320px;         /* altura fija para centrar sin depender del padre */
  align-self: stretch;       /* se estira verticalmente dentro del flex padre */
  color: rgba(255,255,255,0.45);
  font-size: 14px;
}

#pntc-root .pdf-spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--blue-400);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

#pntc-root .pdf-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 320px;
  align-self: stretch;
  color: rgba(255,255,255,0.4);
  font-size: 14px;
  text-align: center;
  padding: 2rem;
}

#pntc-root .pdf-error svg { width: 40px; height: 40px; opacity: 0.3; }


/* Zoom label */
#pntc-root .pdf-zoom-label {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  min-width: 40px;
  text-align: center;
  flex-shrink: 0;
}


/* Close btn */
#pntc-root .pdf-close {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.7);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all .15s;
  flex-shrink: 0;
}

#pntc-root .pdf-close:hover { background: rgba(220,50,50,0.3); border-color: rgba(220,50,50,0.5); color: #fff; }

#pntc-root .pdf-close svg { width: 16px; height: 16px; }


/* Thumbnail strip */
#pntc-root .pdf-thumbs {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  background: #111827;
  border-top: 1px solid rgba(255,255,255,0.07);
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

#pntc-root .pdf-thumbs::-webkit-scrollbar { height: 4px; }

#pntc-root .pdf-thumbs::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }


#pntc-root .pdf-thumb {
  flex-shrink: 0;
  width: 52px;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color .15s;
  line-height: 0;
  position: relative;
}

#pntc-root .pdf-thumb canvas { width: 100%; display: block; }

#pntc-root .pdf-thumb.active { border-color: var(--blue-400); }

#pntc-root .pdf-thumb:hover:not(.active) { border-color: rgba(255,255,255,0.3); }

#pntc-root .pdf-thumb-num {
  position: absolute;
  bottom: 2px; left: 0; right: 0;
  text-align: center;
  font-size: 9px;
  color: rgba(255,255,255,0.6);
  background: rgba(0,0,0,0.45);
}


/* mobile */

@media (max-width: 620px) {
  #pntc-root .pdf-modal { height: 98vh; margin-top: 1vh; border-radius: 12px 12px 0 0; }

  #pntc-root .pdf-toolbar { gap: 6px; padding: 8px 10px; }

  #pntc-root .pdf-toolbar-title { font-size: 11px; }

  #pntc-root .pdf-page-indicator { display: none; }

  #pntc-root .pdf-zoom-label { display: none; }

  #pntc-root .pdf-thumbs { display: none; }


}


/* RESPONSIVE */

@media (max-width: 620px) {
  #pntc-root .pub-hero { padding: 2rem 1.25rem 2rem; }

  #pntc-root .pub-main { padding: 1.5rem 1rem 3rem; }

  #pntc-root .controls-bar { flex-direction: column; align-items: stretch; }

  #pntc-root .sort-select, #pntc-root .view-toggle { align-self: flex-start; }

  #pntc-root .pub-grid { grid-template-columns: 1fr; }

  #pntc-root .pub-grid.list-mode .card { flex-direction: column; }

  #pntc-root .pub-grid.list-mode .card-cover, #pntc-root .pub-grid.list-mode .card-cover-placeholder { width: 100%; height: 120px; }

  #pntc-root .pub-grid.list-mode .card-body { flex-direction: column; }

  #pntc-root .pub-grid.list-mode .card-actions { flex-direction: row; width: auto; }

  #pntc-root .pg-btn { min-width: 32px; height: 32px; font-size: 12px; }


}


/* ─── ESTADO DE CARGA INICIAL ─── */
#pntc-root .pub-initial-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 4rem 2rem;
  color: var(--n500);
  font-size: 14px;
}
#pntc-root .pub-spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--n200);
  border-top-color: var(--blue-600);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
