/* ═══════════════════════════════════════════
   PORTAL DIGITAL — Template CSS
   Una sola barra de navegación, cards horizontales,
   diseño utilitario y rápido de escanear.
   ═══════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --pd-nav-h: 52px;
  --pd-ticker-h: 30px;
  --pd-radius: 6px;
  --pd-gap: 1rem;
  --pd-sidebar-w: 300px;
}

body {
  font-family: var(--font-body, 'Inter', sans-serif);
  background: #f7f7f7;
  color: #111;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 1rem; }

/* ── Navbar ─────────────────────────────── */
.pd-nav {
  background: var(--color-primary, #0A0A0A);
  height: var(--pd-nav-h);
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 0 1rem;
}

.pd-logo {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: -.02em;
}
.pd-logo span { color: var(--color-accent, #0066FF); }

.pd-search {
  display: flex;
  align-items: center;
  gap: .4rem;
  background: rgba(255,255,255,.08);
  border: .5px solid rgba(255,255,255,.12);
  border-radius: 20px;
  padding: .3rem .9rem;
  flex-shrink: 0;
  cursor: pointer;
  transition: background .2s;
}
.pd-search:hover { background: rgba(255,255,255,.14); }
.pd-search-ico { font-size: .85rem; color: rgba(255,255,255,.45); }
.pd-search-txt { font-size: .75rem; color: rgba(255,255,255,.35); white-space: nowrap; }

.pd-sections {
  display: flex;
  align-items: stretch;
  overflow: hidden;
  flex: 1;
  position: relative;
}
.pd-sections a {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: rgba(255,255,255,.55);
  padding: 0 .75rem;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  display: flex;
  align-items: center;
  transition: color .15s;
  height: 100%;
}
.pd-sections a:hover { color: rgba(255,255,255,.9); }
.pd-sections a.active { color: #fff; border-bottom-color: var(--color-accent, #0066FF); }

/* Menú overflow — mismo sistema que antes */
.pd-more-btn {
  background: rgba(255,255,255,.08);
  border: none;
  color: rgba(255,255,255,.75);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 0 .85rem;
  height: 100%;
  cursor: pointer;
  white-space: nowrap;
  display: none;
  align-items: center;
  gap: .3rem;
  transition: background .2s;
}
.pd-more-btn:hover { background: rgba(255,255,255,.15); color: #fff; }
.pd-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 200px;
  background: #1a1a1a;
  border: .5px solid rgba(255,255,255,.1);
  border-radius: 0 0 6px 6px;
  z-index: 300;
  padding: .3rem 0;
}
.pd-dropdown.open { display: block; }
.pd-dropdown a { display: block; padding: .5rem 1rem; font-size: .78rem; color: rgba(255,255,255,.65); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.pd-dropdown a:hover { background: rgba(255,255,255,.07); color: #fff; }

.pd-drawer-btn {
  background: rgba(255,255,255,.1);
  border: none;
  color: rgba(255,255,255,.8);
  font-size: 1rem;
  width: 34px; height: 34px;
  border-radius: 5px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── Ticker ──────────────────────────────── */
.pd-ticker {
  background: var(--color-accent, #0066FF);
  height: var(--pd-ticker-h);
  display: flex;
  align-items: center;
  overflow: hidden;
  gap: 0;
}
.pd-ticker-lbl {
  background: rgba(0,0,0,.2);
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #fff;
  padding: 0 .85rem;
  height: 100%;
  display: flex;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
}
.pd-ticker-track {
  display: flex;
  gap: 2.5rem;
  animation: ticker-scroll 30s linear infinite;
  white-space: nowrap;
  padding: 0 1rem;
}
.pd-ticker-track:hover { animation-play-state: paused; }
@keyframes ticker-scroll { from { transform: translateX(0) } to { transform: translateX(-50%) } }
.pd-ticker-item { font-size: .75rem; font-weight: 500; color: #fff; }
.pd-ticker-item::before { content: '·'; margin-right: .65rem; opacity: .6; }

/* ── Layout principal ────────────────────── */
.pd-body { max-width: 1180px; margin: 0 auto; padding: 1.25rem 1rem; display: grid; grid-template-columns: 1fr var(--pd-sidebar-w); gap: 1.5rem; }
@media (max-width: 900px) { .pd-body { grid-template-columns: 1fr; } }

/* ── Hero ────────────────────────────────── */
.pd-hero {
  position: relative;
  height: 380px;
  border-radius: var(--pd-radius);
  overflow: hidden;
  margin-bottom: 1.25rem;
  background: #111;
}
.pd-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  opacity: .65;
}
.pd-hero-body {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.75rem 1.5rem;
  background: linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,.3) 55%, transparent 100%);
}
.pd-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: rgba(255,255,255,.12);
  border: .5px solid rgba(255,255,255,.25);
  backdrop-filter: blur(4px);
  border-radius: 20px;
  padding: .2rem .75rem;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #fff;
  margin-bottom: .65rem;
  width: fit-content;
}
.pd-badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--color-accent, #0066FF);
  animation: badge-pulse 1.8s ease-in-out infinite;
}
@keyframes badge-pulse { 0%,100% { opacity: 1 } 50% { opacity: .4 } }
.pd-hero-cat {
  display: inline-block;
  background: var(--color-accent, #0066FF);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .18rem .6rem;
  border-radius: 3px;
  margin-bottom: .5rem;
}
.pd-hero h1 {
  font-size: 1.7rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  max-width: 640px;
  margin-bottom: .5rem;
  letter-spacing: -.02em;
}
.pd-hero p {
  font-size: .9rem;
  color: rgba(255,255,255,.7);
  max-width: 560px;
  line-height: 1.5;
}
.pd-hero-meta { font-size: .75rem; color: rgba(255,255,255,.5); margin-top: .4rem; }
@media (max-width: 640px) {
  .pd-hero { height: 260px; }
  .pd-hero h1 { font-size: 1.25rem; }
  .pd-hero-body { padding: 1rem; }
}

/* ── Sección header ──────────────────────── */
.pd-section-hd {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .85rem;
}
.pd-section-hd-lbl {
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--color-accent, #0066FF);
  white-space: nowrap;
}
.pd-section-hd-line { flex: 1; height: 1px; background: #e5e5e5; }

/* ── Cards horizontales ─────────────────── */
.pd-cards { display: flex; flex-direction: column; gap: .75rem; }

.pd-card {
  background: #fff;
  border-radius: var(--pd-radius);
  border: .5px solid #e5e5e5;
  display: flex;
  gap: 0;
  overflow: hidden;
  transition: box-shadow .2s;
}
.pd-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,.08); }

.pd-card-img {
  width: 130px;
  min-height: 100px;
  flex-shrink: 0;
  overflow: hidden;
  background: #f0f0f0;
}
.pd-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}
.pd-card:hover .pd-card-img img { transform: scale(1.04); }

.pd-card-body {
  padding: .85rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  min-width: 0;
}
.pd-card-cat {
  font-size: .65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--color-accent, #0066FF);
  margin-bottom: .3rem;
}
.pd-card-body h2 {
  font-size: .95rem;
  font-weight: 700;
  line-height: 1.35;
  color: #111;
  margin-bottom: .3rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pd-card-body h2 a:hover { color: var(--color-accent, #0066FF); }
.pd-card-resumen {
  font-size: .78rem;
  color: #666;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: .4rem;
}
.pd-card-time { font-size: .72rem; color: #999; }

@media (max-width: 480px) {
  .pd-card-img { width: 90px; }
  .pd-card-body { padding: .65rem .75rem; }
}

/* ── Sidebar ─────────────────────────────── */
.pd-sidebar { display: flex; flex-direction: column; gap: 1rem; }

.pd-widget {
  background: #fff;
  border-radius: var(--pd-radius);
  border: .5px solid #e5e5e5;
  overflow: hidden;
}
.pd-widget-hd {
  padding: .6rem 1rem;
  font-size: .7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #111;
  border-bottom: .5px solid #f0f0f0;
  background: #fafafa;
}
.pd-widget-item {
  display: flex;
  gap: .65rem;
  padding: .7rem 1rem;
  border-bottom: .5px solid #f5f5f5;
  align-items: center;
}
.pd-widget-item:last-child { border-bottom: none; }
.pd-widget-item:hover { background: #fafafa; }
.pd-widget-img {
  width: 52px;
  height: 42px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  background: #f0f0f0;
}
.pd-widget-img img { width: 100%; height: 100%; object-fit: cover; }
.pd-widget-txt { font-size: .8rem; font-weight: 600; color: #222; line-height: 1.3; flex: 1; min-width: 0; }
.pd-widget-time { font-size: .68rem; color: #999; margin-top: .2rem; }

.pd-banner-slot {
  background: repeating-linear-gradient(45deg,#f8f8f8 0,#f8f8f8 4px,#f0f0f0 4px,#f0f0f0 8px);
  border-radius: var(--pd-radius);
  border: .5px dashed #ddd;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  color: #bbb;
  overflow: hidden;
}

/* ── Tags footer bar ─────────────────────── */
.pd-tags-bar {
  background: #fff;
  border-top: .5px solid #e5e5e5;
  padding: .6rem 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}
.pd-tags-bar-lbl { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: #999; margin-right: .25rem; }
.pd-tag {
  background: #f0f5ff;
  border: .5px solid #c7d9ff;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 600;
  color: var(--color-accent, #0066FF);
  padding: .2rem .7rem;
  transition: background .15s;
}
.pd-tag:hover { background: #dce9ff; }
.pd-tag.active { background: var(--color-accent, #0066FF); color: #fff; border-color: var(--color-accent, #0066FF); }

/* ── Paginación ──────────────────────────── */
.pd-paginacion {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .4rem;
  margin: 1.5rem 0 .5rem;
}
.pd-paginacion a, .pd-paginacion span {
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  font-size: .82rem;
  font-weight: 600;
  border: .5px solid #e5e5e5;
  background: #fff;
  color: #333;
  transition: all .15s;
}
.pd-paginacion a:hover { background: var(--color-accent, #0066FF); color: #fff; border-color: var(--color-accent, #0066FF); }
.pd-paginacion span { background: var(--color-accent, #0066FF); color: #fff; border-color: var(--color-accent, #0066FF); }

/* ── Footer ──────────────────────────────── */
.pd-footer {
  background: var(--color-primary, #0A0A0A);
  color: rgba(255,255,255,.55);
  padding: 2rem 1rem;
  margin-top: 2rem;
  font-size: .82rem;
  margin-top: auto;
}
.pd-footer-inner { max-width: 1180px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.pd-footer-name { font-size: 1rem; font-weight: 700; color: #fff; }
.pd-footer-links { display: flex; gap: 1rem; }
.pd-footer-links a { color: rgba(255,255,255,.45); font-size: .78rem; }
.pd-footer-links a:hover { color: rgba(255,255,255,.8); }

/* ── Drawer mobile (mismo sistema base) ──── */
.pd-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 700; }
.pd-overlay.open { display: block; }
.pd-drawer {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #fff;
  border-radius: 16px 16px 0 0;
  z-index: 800;
  padding: 1rem 1rem 2rem;
  max-height: 70vh;
  overflow-y: auto;
}
.pd-drawer.open { display: block; }
.pd-drawer-handle { width: 32px; height: 4px; background: #ddd; border-radius: 2px; margin: 0 auto .85rem; }
.pd-drawer-title { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: #999; margin-bottom: .75rem; }
.pd-drawer-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: .4rem; }
.pd-drawer-item {
  display: flex; align-items: center; justify-content: center;
  padding: .6rem .4rem;
  background: #f5f5f5;
  border-radius: 7px;
  font-size: .78rem;
  font-weight: 600;
  color: #222;
  text-align: center;
  min-height: 44px;
  transition: background .15s;
}
.pd-drawer-item:hover { background: #ebebeb; }
.pd-drawer-item.active { background: var(--color-accent, #0066FF); color: #fff; }

/* ══════════════════════════════════════════════════════════════
   FIXES — Mobile bottom nav + ticker + proporciones desktop
   ══════════════════════════════════════════════════════════════ */

/* ── Bottom nav bar (mobile app style) ───────────────────────── */
.pd-bottom-nav {
  display: none !important;
}
/* SVG sin tamaño por defecto — previene render gigante si CSS falla */
.pd-bottom-nav-item svg {
  width: 0; height: 0; overflow: hidden;
}
@media (max-width: 720px) {
  .pd-bottom-nav {
    display: flex !important;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 58px;
    background: #fff;
    border-top: .5px solid #e0e0e0;
    box-shadow: 0 -2px 12px rgba(0,0,0,.08);
    z-index: 500;
    align-items: stretch;
  }
  .pd-bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: .6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #aaa;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    transition: color .15s;
    text-decoration: none;
  }
  .pd-bottom-nav-item.active { color: var(--color-accent, #0066FF); }
  .pd-bottom-nav-item svg { width: 22px !important; height: 22px !important; overflow: visible; stroke-width: 1.8; }

  /* Espacio para que el contenido no quede detrás del bottom nav */
  body { padding-bottom: 62px; }

  /* Ocultar el hamburger del navbar ya que tenemos bottom nav */
  .pd-drawer-btn { display: none !important; }

  /* En mobile el navbar se simplifica: solo logo + search */
  .pd-sections { display: none !important; }
  .pd-more-btn  { display: none !important; }
}

/* ── Ticker — label más sólido ───────────────────────────────── */
.pd-ticker-lbl {
  background: rgba(0,0,0,.35) !important;
  min-width: 110px;
  justify-content: center;
}

/* ── Desktop — proporciones hero + sidebar ───────────────────── */
@media (min-width: 901px) {
  /* Sidebar menos ancha para dar más espacio al contenido */
  :root { --pd-sidebar-w: 260px; }

  /* Hero más compacto */
  .pd-hero { height: 340px; }

  /* Si el sidebar no tiene notas reales, colapsar banners vacíos */
  .pd-banner-slot { min-height: 70px; }
}

/* ── Desktop sidebar — "Últimas noticias" sin imagen si no hay foto ── */
.pd-widget-item:not(:has(.pd-widget-img)) .pd-widget-txt {
  padding-left: 0;
}

/* ── Cards en mobile — thumb un poco más grande ─────────────── */
@media (max-width: 480px) {
  .pd-card-img { width: 100px; min-height: 82px; }
  .pd-hero { height: 240px; }
  .pd-hero h1 { font-size: 1.15rem; }
}

/* ══ FIX TICKER OVERLAP ═══════════════════════════════════════
   El ticker queda en flujo normal debajo del sticky nav.
   Asignamos z-index explícito menor para evitar conflictos.
   En mobile el label es más oscuro para contrastar con el azul.
   ═════════════════════════════════════════════════════════════ */
.pd-ticker {
  position: relative;
  z-index: 100;        /* siempre debajo del nav (z:200) */
}

/* Sticky combinado: nav + ticker juntos como bloque pegajoso */
.pd-sticky-wrap {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--color-primary, #0A0A0A);
}
/* Si el HTML tiene pd-sticky-wrap, el nav ya no necesita sticky propio */
.pd-sticky-wrap .pd-nav {
  position: relative;
  z-index: auto;
}

/* ══════════════════════════════════════════════════════════════
   FIXES R3 — Ticker sólido, logo mobile, social drawer
   ══════════════════════════════════════════════════════════════ */

/* ── Ticker label: fondo SÓLIDO para tapar texto que pasa atrás ─── */
.pd-ticker-lbl {
  background: var(--color-primary, #0A0A0A) !important;
  color: #fff !important;
  position: relative;
  z-index: 2;
}
/* Sombra derecha para fade visual suave */
.pd-ticker-lbl::after {
  content: '';
  position: absolute;
  right: -18px; top: 0; bottom: 0;
  width: 18px;
  background: linear-gradient(to right, var(--color-primary, #0A0A0A), transparent);
  pointer-events: none;
}

/* ── Logo mobile: centrado y más grande ─────────────────────────── */
.pd-logo-img {
  height: 40px;
  width: auto;
  display: block;
  object-fit: contain;
}
@media (max-width: 720px) {
  .pd-nav {
    justify-content: center;
    position: relative;
  }
  .pd-logo {
    font-size: 1.35rem;
    letter-spacing: -.03em;
  }
  .pd-logo-img {
    height: 38px;
  }
  /* Ocultar search del navbar en mobile — está en bottom nav */
  .pd-search { display: none !important; }
}

/* ── Social links en drawer ─────────────────────────────────────── */
.pd-drawer-social {
  border-top: 1px solid #eee;
  padding: 1.25rem 1rem .5rem;
  margin-top: .75rem;
}
.pd-drawer-social-title {
  font-size: .65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #aaa;
  margin-bottom: .65rem;
}
.pd-drawer-social-links {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.pd-drawer-social-btn {
  display: flex;
  align-items: center;
  gap: .7rem;
  color: #333;
  text-decoration: none;
  font-size: .88rem;
  font-weight: 500;
  padding: .55rem .65rem;
  border-radius: 8px;
  transition: background .15s;
}
.pd-drawer-social-btn:hover,
.pd-drawer-social-btn:focus {
  background: #f3f3f3;
  color: #000;
}

/* ══ FIXES R5 — Hero resumen truncado + social visible + logo ══ */

/* Hero: resumen limitado a 2 líneas, texto más pequeño */
.pd-hero-resumen {
  font-size: .85rem;
  line-height: 1.45;
  color: rgba(255,255,255,.82);
  margin: .4rem 0 .5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* En mobile: solo 1 línea */
@media (max-width: 720px) {
  .pd-hero-resumen {
    -webkit-line-clamp: 1;
    line-clamp: 1;
    font-size: .8rem;
  }
}

/* "Leer más →" en el hero */
.pd-hero-leer {
  display: inline-block;
  margin-left: .6rem;
  font-size: .75rem;
  font-weight: 700;
  color: var(--color-accent, #0066FF);
  background: rgba(255,255,255,.12);
  padding: .15rem .5rem;
  border-radius: 4px;
  vertical-align: middle;
  letter-spacing: .02em;
}

/* Logo mobile: asegurar tamaño correcto */
@media (max-width: 720px) {
  .pd-logo { font-size: 1.4rem; font-weight: 800; }
  .pd-logo-img { height: 40px !important; max-width: 180px; object-fit: contain; }
}
