/* ── VARIABLES MÓVIL (usadas por el CSS unificado en base.css) ── */
body.wb-template-9 {
  --wb-m-font:       -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --wb-m-btn-bg:     #0f172a;
  --wb-m-btn-color:  white;
  --wb-m-btn-border: none;
  --wb-m-btn-radius: 10px;
  --wb-m-accent:     #3b82f6;
  --wb-m-hero-bg:    #3b82f6;
  --wb-m-page-bg:    #f1f5f9;
  --wb-m-text:       #0f172a;
}

/* ============================================================
   TEMPLATE 9: TIMELINE
   Sección superior: imagen hero a pantalla completa.
   Sin hero: fondo del color del nodo timeline (#3b82f6).
   Panel nombre/avatar/logo semitransparente sobre el hero.
   Sección inferior: 3 columnas con línea y nodos timeline.
   Col 1: Portfolio | Col 2: reservada | Col 3: reservada
   Nombre en panel: "Timeline"
============================================================ */

/* ── BASE ─────────────────────────────────────────────────── */
body.wb-template-9 {
  background: #f1f5f9;
  padding: 0;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  overflow-x: hidden;
}

body.wb-template-9 .wb-wrap {
  max-width: none;
  padding: 0;
}

/* ── SECCIÓN HERO ─────────────────────────────────────────── */
/* Sin imagen: fondo azul timeline. Con imagen: el JS la aplica */
body.wb-template-9 .wb-hero-section {
  position: relative;
  min-height: 340px;
  display: flex;
  align-items: flex-end;
  background: #3b82f6;
  overflow: hidden;
}

/* El #wbHero lo ocultamos: usamos hero-section directamente como fondo */
body.wb-template-9 #wbHero {
  display: none !important;
}

/* Gradiente oscuro de abajo hacia arriba para legibilidad */
body.wb-template-9 .wb-hero-section::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.65) 0%,
    rgba(0,0,0,0.25) 55%,
    rgba(0,0,0,0.05) 100%
  );
  z-index: 1;
  pointer-events: none;
}

/* ── PANEL NOMBRE/AVATAR/LOGO sobre el hero ───────────────── */
body.wb-template-9 .wb-hero-overlay {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 28px 40px 32px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid rgba(255,255,255,0.2);
}

body.wb-template-9 .wb-profile-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
  color: white;
}

body.wb-template-9 .wb-avatar-container {
  flex-shrink: 0;
}

body.wb-template-9 .wb-avatar {
  width: 88px;
  height: 88px;
  background: rgba(255,255,255,0.2);
  border: 3px solid rgba(255,255,255,0.55);
  color: white;
  font-weight: 700;
  font-size: 28px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

body.wb-template-9 .wb-profile-info {
  flex: 1;
  min-width: 0;
}

body.wb-template-9 .wb-name {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 4px;
  color: white;
  text-shadow: 0 1px 6px rgba(0,0,0,0.4);
  line-height: 1.2;
}

body.wb-template-9 .wb-prof {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  margin: 0 0 3px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

body.wb-template-9 .wb-location,
body.wb-template-9 .wb-address {
  font-size: 13px;
  color: rgba(255,255,255,0.75);
  margin: 0;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Logo: sin filtros, se muestra tal cual */




/* ── BIO + BOTONES ────────────────────────────────────────── */
body.wb-template-9 .wb-bio-section,
body.wb-template-9 .wb-actions-section {
  display: block;
  background: white;
  padding: 44px 40px;
  position: relative;
  z-index: 1;
}

body.wb-template-9 .wb-card {
  max-width: 1200px;
  margin: 0 auto;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

body.wb-template-9 .wb-bio {
  font-size: 16px;
  color: #475569;
  margin-bottom: 28px;
  line-height: 1.7;
}

body.wb-template-9 .wb-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

body.wb-template-9 .wb-btn {
  background: #0f172a;
  color: white;
  border: none;
}

body.wb-template-9 .wb-btn:hover {
  background: #1e293b;
  transform: translateY(-2px);
}

/* ── SECCIÓN INFERIOR: 3 columnas ────────────────────────── */
/* Gallery: fila completa debajo de las 3 columnas de la timeline */
/* gallery moved inside wb-timeline-col-center */

body.wb-template-9 .wb-modules-container {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr; /* default 3 cols */
  gap: 0;
  background: #f1f5f9;
  max-width: none;
  padding: 0;
  margin: 0;
}

body.wb-template-9 .wb-modules-container > * {
  position: relative;
  padding: 40px 36px 60px;
  border-right: 1px solid #e2e8f0;
  background: white;
  min-width: 0;       /* imprescindible en grid: evita que 1fr se expanda por el contenido */
  overflow: hidden;
  box-sizing: border-box;
}

/* #wbModules necesita overflow:visible para que los nodos circulares del timeline
   (::before en wb-portfolio-card, left:-26px) no queden recortados */
body.wb-template-9 #wbModules {
  overflow: visible;
}

body.wb-template-9 .wb-modules-container > *:nth-child(odd) {
  background: #f8fafc;
}

body.wb-template-9 .wb-modules-container > *:last-child {
  border-right: none;
}

/* Título de columna estilo etiqueta timeline */
body.wb-template-9 .wb-section-title {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 20px;
}

/* ── PORTFOLIO (col 1): timeline lateral ─────────────────── */
body.wb-template-9 .wb-portfolio-grid {
  display: flex;
  flex-direction: column;
  position: relative;
  padding-left: 28px;
}

/* Línea vertical continua */
body.wb-template-9 .wb-portfolio-grid::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(to bottom, #3b82f6, #bfdbfe 85%, transparent 100%);
}

/* Cada tarjeta como evento del timeline — imagen izq + texto der */
body.wb-template-9 .wb-portfolio-card {
  position: relative;
  display: grid;
  grid-template-columns: 110px 1fr;
  align-items: center;
  background: white;
  border-radius: 10px;
  overflow: visible; /* visible para que el nodo ::before no quede recortado */
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  margin-bottom: 16px;
  transition: all 0.25s;
}
body.wb-template-9 .wb-portfolio-card.wb-no-media { grid-template-columns: 1fr; }

/* Nodo circular en cada tarjeta */
body.wb-template-9 .wb-portfolio-card::before {
  content: '';
  position: absolute;
  left: -26px;
  top: 18px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: white;
  border: 2px solid #3b82f6;
  box-shadow: 0 0 0 3px #dbeafe;
  z-index: 1;
}

body.wb-template-9 .wb-portfolio-card:hover {
  transform: translateX(4px);
  box-shadow: 0 6px 18px rgba(59,130,246,0.15);
  border-color: #93c5fd;
}

/* Imagen: columna izquierda, altura fija, overflow hidden solo aquí */
body.wb-template-9 .wb-portfolio-media {
  width: 110px;
  height: 90px;
  aspect-ratio: unset;
  border-radius: 10px 0 0 10px;
  overflow: hidden;
  flex-shrink: 0;
  align-self: stretch;
}

body.wb-template-9 .wb-portfolio-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Texto: columna derecha */
body.wb-template-9 .wb-portfolio-content {
  padding: 10px 14px;
  min-width: 0;
}

body.wb-template-9 .wb-portfolio-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 3px;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.wb-template-9 .wb-portfolio-subtitle { font-size: 13px; color: #64748b; margin-bottom: 6px; font-style: italic; }

body.wb-template-9 .wb-portfolio-subtitle {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
  margin-bottom: 4px;
}

body.wb-template-9 .wb-portfolio-desc {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Tarjetas de futuros módulos: mismo estilo horizontal */
body.wb-template-9 .wb-timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 110px 1fr;
  align-items: center;
  background: white;
  border-radius: 10px;
  overflow: visible;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  margin-bottom: 16px;
  transition: all 0.25s;
}

body.wb-template-9 .wb-timeline-item:hover {
  transform: translateX(4px);
  box-shadow: 0 6px 18px rgba(59,130,246,0.15);
  border-color: #93c5fd;
}

body.wb-template-9 .wb-timeline-item-media {
  width: 110px;
  height: 90px;
  border-radius: 10px 0 0 10px;
  overflow: hidden;
  align-self: stretch;
}

body.wb-template-9 .wb-timeline-item-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

body.wb-template-9 .wb-timeline-item-content {
  padding: 10px 14px;
  min-width: 0;
}

/* ── COLUMNA 2 (testimonios): línea vertical + nodo ─────────── */
body.wb-template-9 .wb-timeline-col-left {
  position: relative;
  padding-left: 28px;
  min-height: 0;
}
body.wb-template-9 .wb-timeline-col-left::before {
  content: '';
  position: absolute;
  left: 6px; top: 6px; bottom: 6px; width: 2px;
  background: linear-gradient(to bottom, #3b82f6, #bfdbfe 85%, transparent 100%);
}
body.wb-template-9 .wb-timeline-col-left .wb-module--testimonials::before {
  content: '';
  position: absolute;
  left: -26px; top: 14px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: white;
  border: 2px solid #3b82f6;
  box-shadow: 0 0 0 3px #dbeafe;
  z-index: 1;
}

/* ── COLUMNA 3 (mapa + horario): línea ya definida abajo ────── */
body.wb-template-9 .wb-timeline-col-right {
  min-height: 0;
}
/* T9: columna central (portfolio + galería) */
body.wb-template-9 .wb-timeline-col-center {
  display: flex;
  flex-direction: column;
  padding: 40px 30px;
  background: #ffffff;
  min-height: 100%;
  box-sizing: border-box;
}
/* Gallery dentro de col-center: sin padding extra */
body.wb-template-9 .wb-timeline-col-center .wb-module--gallery {
  padding: 0;
}


/* Línea vertical para futuros módulos en col 2 y col 3 */
body.wb-template-9 .wb-timeline-col-left .wb-timeline-list,
body.wb-template-9 .wb-timeline-col-right .wb-timeline-list {
  display: flex;
  flex-direction: column;
  position: relative;
  padding-left: 28px;
}

body.wb-template-9 .wb-timeline-col-left .wb-timeline-list::before,
body.wb-template-9 .wb-timeline-col-right .wb-timeline-list::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(to bottom, #3b82f6, #bfdbfe 85%, transparent 100%);
}

/* Nodo para futuros items */
body.wb-template-9 .wb-timeline-item {
  position: relative;
  margin-bottom: 20px;
}

body.wb-template-9 .wb-timeline-item::before {
  content: '';
  position: absolute;
  left: -26px;
  top: 10px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: white;
  border: 2px solid #3b82f6;
  box-shadow: 0 0 0 3px #dbeafe;
  z-index: 1;
}

/* ── FOOTER ───────────────────────────────────────────────── */
body.wb-template-9 .wb-footer-section {
  padding: 16px 40px;
  border-top: 1px solid #e2e8f0;
  background: white;
}

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 1024px) {
  body.wb-template-9 .wb-modules-container {
    grid-template-columns: 1fr 1fr;
  }
  body.wb-template-9 .wb-timeline-col-right {
    grid-column: 1 / -1;
    border-top: 1px solid #e2e8f0;
    border-right: none;
  }
  body.wb-template-9 .wb-actions {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  /* Wrap → flex columna (necesario para que order funcione) */
  body.wb-template-9 .wb-wrap[data-wb-v5="1"] {
    display: flex !important;
    flex-direction: column !important;
    max-width: 100% !important;
    padding: 0 !important;
    grid-template-columns: unset !important;
    overflow-x: hidden !important;
  }
  body.wb-template-9 .wb-wrap[data-wb-v5="1"] > * {
    grid-column: unset !important;
    grid-row: unset !important;
    grid-area: unset !important;
    width: 100% !important;
    box-sizing: border-box !important;
    position: relative !important;
    overflow-x: hidden !important;
  }
  /* Columnas internas del modules-container → apiladas */
  body.wb-template-9 .wb-modules-container {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: unset !important;
  }
  body.wb-template-9 .wb-timeline-col-left,
  body.wb-template-9 .wb-timeline-col-center,
  body.wb-template-9 .wb-timeline-col-right {
    width: 100% !important;
    border-right: none !important;
    border-bottom: 1px solid #e2e8f0;
    padding: 24px 20px 32px !important;
    box-sizing: border-box !important;
  }
  body.wb-template-9 .wb-hero-section {
    min-height: 260px;
  }
  body.wb-template-9 .wb-hero-overlay {
    padding: 20px 20px 24px;
  }
  body.wb-template-9 .wb-avatar {
    width: 68px;
    height: 68px;
    font-size: 22px;
  }
  body.wb-template-9 .wb-name {
    font-size: 20px;
  }
  body.wb-template-9 .wb-bio-section,
  body.wb-template-9 .wb-actions-section {
    padding: 32px 20px;
  }
  body.wb-template-9 .wb-actions {
    grid-template-columns: 1fr;
  }
  body.wb-template-9 .wb-timeline-col-right {
    grid-column: unset;
  }
  body.wb-template-9 .wb-portfolio-card,
  body.wb-template-9 .wb-timeline-item {
    grid-template-columns: 1fr;
  }
  body.wb-template-9 .wb-portfolio-media,
  body.wb-template-9 .wb-timeline-item-media {
    width: 100%;
    height: 160px;
    border-radius: 10px 10px 0 0;
  }
  body.wb-template-9 .wb-portfolio-card::before,
  body.wb-template-9 .wb-timeline-item::before {
    top: -5px;
    left: 16px;
  }

  body.wb-template-9 .wb-logo-container img {
  width: auto;
  height: 92px;
  max-width: 184px;
  max-height: 92px;
  object-fit: contain;
  background: transparent;
  display: block;
}

  /* Orden móvil: datos → botones → bio */
  body.wb-template-9 .wb-wrap[data-wb-v5="1"] > .wb-hero-section { order: 1 !important; }
  body.wb-template-9 .wb-wrap[data-wb-v5="1"] > .wb-actions-section { order: 2 !important; }
  body.wb-template-9 .wb-wrap[data-wb-v5="1"] > .wb-bio-section { order: 3 !important; }
  body.wb-template-9 .wb-wrap[data-wb-v5="1"] > .wb-modules-container { order: 5 !important; }
  body.wb-template-9 .wb-wrap[data-wb-v5="1"] > .wb-col-extra { order: 7 !important; }
  body.wb-template-9 .wb-wrap[data-wb-v5="1"] > .wb-footer-section { order: 99 !important; }
}

/* ── MAPA: tarjeta visual = portfolio-card, título = section-title ── */
body.wb-template-9 .wb-timeline-col-right .wb-module--map {
  flex-direction: column;
  overflow: hidden;
}
body.wb-template-9 .wb-timeline-col-right .wb-module--map[style*="display: none"],
body.wb-template-9 .wb-timeline-col-right .wb-module--map[style*="display:none"] {
  display: none !important;
}

body.wb-template-9 .wb-module-title {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 20px;
}
body.wb-template-9 .wb-timeline-col-right .wb-module--map .wb-map-body {
  flex: 1;
  padding: 0 12px 12px;
  min-height: 0;
}
body.wb-template-9 .wb-timeline-col-right .wb-module--map .wb-map-iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  border-radius: 8px;
}
body.wb-template-9 .wb-timeline-col-right {
  position: relative;
  padding-left: 28px;
}
body.wb-template-9 .wb-timeline-col-right::before {
  content: '';
  position: absolute;
  left: 6px; top: 6px; bottom: 6px; width: 2px;
  background: linear-gradient(to bottom, #3b82f6, #bfdbfe 85%, transparent 100%);
}
body.wb-template-9 .wb-timeline-col-right .wb-module--map::before {
  content: '';
  position: absolute;
  left: -26px; top: 14px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: white;
  border: 2px solid #3b82f6;
  box-shadow: 0 0 0 3px #dbeafe;
  z-index: 1;
}

body.wb-template-9 .wb-logo-container {
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
  padding: 0 0 0 20px;
  max-width: 200px;
}
body.wb-template-9 .wb-logo-container img {
  width: auto;
  height: 119px;
  max-width: 238px;
  max-height: 119px;
  object-fit: contain;
  background: transparent;
  display: block;
}

/* Schedule y testimonials en columnas laterales del timeline */
body.wb-template-9 .wb-timeline-col-right .wb-module--schedule {
  display: block;
  width: 100%;
}
body.wb-template-9 .wb-timeline-col-left .wb-module--testimonials {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  position: relative;
}
body.wb-template-9 .wb-timeline-col-left .wb-testimonials-carousel,
body.wb-template-9 .wb-timeline-col-left .wb-testimonials-list,
body.wb-template-9 .wb-timeline-col-left .wb-testimonial-card {
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

/* ── COLUMNAS ADAPTATIVAS ──────────────────────────────── */
/* lcr = izq(testimonios) + centro(portfolio) + der(mapa/horario) */
body.wb-template-9 .wb-modules-container[data-t9cols="lcr"] {
  grid-template-columns: 1fr 2fr 1fr;
}
/* lc = izq(testimonios) + centro(portfolio), sin mapa/horario */
body.wb-template-9 .wb-modules-container[data-t9cols="lc"] {
  grid-template-columns: 1fr 2fr;
}
/* cr = centro(portfolio) + der(mapa/horario), sin testimonios */
body.wb-template-9 .wb-modules-container[data-t9cols="cr"] {
  grid-template-columns: 2fr 1fr;
}
/* c = solo centro(portfolio) */
body.wb-template-9 .wb-modules-container[data-t9cols="c"] {
  grid-template-columns: 1fr;
}
body.wb-template-9 .wb-timeline-col-left:empty,
body.wb-template-9 .wb-timeline-col-right:empty {
  display: none;
  padding: 0;
  border: none;
  min-height: 0;
}

/* ── PUBLICACIONES T9 — dentro de wb-timeline-col-center ──── */
body.wb-template-9 .wb-timeline-col-center .wb-publications-section {
  padding: 24px 0 40px;
  margin-top: 24px;
  box-sizing: border-box;
  width: 100%;
}
body.wb-template-9 .wb-timeline-col-center .wb-publications-section .wb-pub-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}
body.wb-template-9 .wb-timeline-col-center .wb-publications-section .wb-pub-date { color: #3b82f6; font-weight: 600; font-size: 11px; }
body.wb-template-9 .wb-timeline-col-center .wb-publications-section .wb-pub-ptitle { color: #0f172a; font-weight: 700; }
body.wb-template-9 .wb-timeline-col-center .wb-publications-section .wb-pub-more { color: #3b82f6; }
@media (max-width: 768px) {
  body.wb-template-9 .wb-timeline-col-center .wb-publications-section { padding: 24px 0 40px; margin-top: 16px; }
}

/* Redes sociales */
body.wb-template-9 .wb-social-links { padding: 10px 0 0; }
