/* ============================================
   TWL Servicios Hub V2 — Premium redesign
   ============================================ */
.twl-servicios-hub {
  --hub-accent: #ff6a00;
  --hub-bg: #0a0a0a;
  --hub-card-bg: rgba(255,255,255,0.03);
  --hub-border: rgba(255,255,255,0.08);
  --hub-border-accent: rgba(255,106,0,0.3);
  --hub-text: #ffffff;
  --hub-text-muted: rgba(255,255,255,0.6);
  --hub-text-subtle: rgba(255,255,255,0.35);
  --hub-radius: 16px;
  --hub-space-section: clamp(80px, 12vw, 160px);
  --hub-ease: cubic-bezier(0.2, 0.9, 0.2, 1);
}

/* ── Alternating sections ── */
.twl-hub-section { position: relative; margin: 0; }

.twl-hub-section--dark {
  background: var(--hub-bg);
  color: var(--hub-text);
}
.twl-hub-section--dark::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
  z-index: 0;
}
.twl-hub-section--dark::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--hub-border-accent), transparent);
  z-index: 1;
}
.twl-hub-section--dark > * { position: relative; z-index: 1; }

.twl-hub-section--light {
  background: #f5f5f5;
  color: #1a1a1a;
}

/* ── Hero ── */
.twl-hub-hero {
  padding: clamp(100px, 15vw, 180px) 0 clamp(60px, 8vw, 100px);
  text-align: center;
  background: radial-gradient(ellipse at 50% 0%, rgba(255,106,0,0.06) 0%, transparent 70%);
}
.twl-hub-hero__label {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--hub-accent);
  border: 1px solid var(--hub-border-accent);
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: 1.5rem;
}
.twl-hub-hero h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  color: #fff;
  margin: 0 0 1rem;
  line-height: 1.1;
}
.twl-hub-hero__sub {
  color: var(--hub-text-muted);
  font-size: 1.15rem;
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ── Intro (light) ── */
.twl-hub-intro { padding: var(--hub-space-section) 0; margin-top: 0; }
.twl-hub-intro__statement {
  max-width: 800px;
  margin: 0 auto 3rem;
  text-align: center;
  font-size: clamp(1.3rem, 2.5vw, 1.7rem);
  line-height: 1.5;
  color: #1a1a1a;
  font-weight: 400;
}
.twl-hub-intro__statement em {
  color: var(--hub-accent);
  font-style: normal;
  font-weight: 600;
}
.twl-hub-intro__details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  max-width: 900px;
  margin: 0 auto;
}
.twl-hub-intro__details p {
  color: #555;
  font-size: .95rem;
  line-height: 1.75;
  margin: 0;
}
.twl-hub-intro__details strong { color: #1a1a1a; }

/* ── Grid section ── */
.twl-hub-grid-section { padding: var(--hub-space-section) 0; }

.twl-hub-category__header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.25rem;
  text-align: center;
}
.twl-hub-section--dark .twl-hub-category__header { border-bottom: 1px solid var(--hub-border); }
.twl-hub-section--light .twl-hub-category__header { border-bottom: 1px solid #ddd; }

.twl-hub-category__title {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  color: var(--hub-accent);
  margin: 0 0 .5rem;
}
.twl-hub-section--light .twl-hub-category__title { color: var(--hub-accent); }
.twl-hub-category__desc { color: var(--hub-text-muted); font-size: 1rem; margin: 0; }
.twl-hub-section--light .twl-hub-category__desc { color: #555; }

.twl-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  max-width: 1000px;
  margin: 0 auto;
}

/* ── Cards ── */
.twl-hub-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.25rem;
  background: var(--hub-card-bg);
  border: 1px solid var(--hub-border);
  border-radius: var(--hub-radius);
  text-decoration: none;
  color: #fff;
  transition: border-color .3s var(--hub-ease), transform .4s var(--hub-ease), box-shadow .4s var(--hub-ease);
  overflow: hidden;
  min-height: 280px;
  max-height: 340px;
  justify-content: flex-end;
}
.twl-hub-card:hover {
  border-color: var(--hub-border-accent);
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(255,106,0,0.1);
}

/* Light section cards */
.twl-hub-section--light .twl-hub-card {
  background: #fff;
  border-color: #e0e0e0;
  color: #1a1a1a;
}
.twl-hub-section--light .twl-hub-card:hover {
  border-color: var(--hub-accent);
  box-shadow: 0 8px 32px rgba(255,106,0,0.08);
}
.twl-hub-section--light .twl-hub-card__desc { color: #666; }
.twl-hub-section--light .twl-hub-card__cta { color: var(--hub-accent); }

/* Cards with video backgrounds */
.twl-hub-card--has-video { position: relative; overflow: hidden; }
.twl-hub-card__video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 0;
}
.twl-hub-card__overlay {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.85) 100%);
}
.twl-hub-card--has-video > *:not(.twl-hub-card__video):not(.twl-hub-card__overlay) {
  position: relative; z-index: 2;
}
.twl-hub-card--has-video .twl-hub-card__desc { color: rgba(255,255,255,0.8); }
.twl-hub-card--has-video .twl-hub-card__cta { color: var(--hub-accent); }

/* Cards with background images */
.twl-hub-card--has-img {
  background-size: cover;
  background-position: center;
  color: #fff;
}
.twl-hub-section--light .twl-hub-card--has-img { color: #fff; }
.twl-hub-section--light .twl-hub-card--has-img .twl-hub-card__desc { color: rgba(255,255,255,0.8); }
.twl-hub-section--light .twl-hub-card--has-img .twl-hub-card__cta { color: var(--hub-accent); }

.twl-hub-card__badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255,106,0,0.15);
  color: var(--hub-accent);
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 100px;
  letter-spacing: .04em;
  border: 1px solid rgba(255,106,0,0.25);
  backdrop-filter: blur(8px);
  z-index: 2;
}

.twl-hub-card__title { font-size: 1.25rem; margin: 0 0 .5rem; }
.twl-hub-card__desc { font-size: .9rem; color: rgba(255,255,255,0.7); flex: 1; margin: 0 0 1rem; line-height: 1.5; }
.twl-hub-card__cta {
  font-size: .85rem;
  color: var(--hub-accent);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap .3s var(--hub-ease);
}
.twl-hub-card:hover .twl-hub-card__cta { gap: 10px; }

/* ── Cross-links (dark) ── */
.twl-hub-crosslinks { padding: var(--hub-space-section) 0; }
.twl-hub-crosslinks h2 {
  text-align: center;
  color: #fff;
  margin-bottom: 2.5rem;
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
}
.twl-hub-crosslinks__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.twl-hub-crosslink {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: 1.25rem;
  background: var(--hub-card-bg);
  border: 1px solid var(--hub-border);
  border-radius: var(--hub-radius);
  text-decoration: none;
  transition: border-color .3s var(--hub-ease), transform .4s var(--hub-ease), box-shadow .4s var(--hub-ease);
}
.twl-hub-crosslink:hover {
  border-color: var(--hub-border-accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(255,106,0,0.1);
}
.twl-hub-crosslink strong { color: #fff; font-size: .95rem; }
.twl-hub-crosslink span { color: var(--hub-text-muted); font-size: .85rem; line-height: 1.4; }

/* ── Why (light) ── */
.twl-hub-why { padding: var(--hub-space-section) 0; }
.twl-hub-why h2 {
  text-align: center;
  color: #1a1a1a;
  margin-bottom: 2.5rem;
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
}
.twl-hub-why__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
}
.twl-hub-why__item {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: var(--hub-radius);
  padding: 1.75rem;
  transition: transform .4s var(--hub-ease), box-shadow .4s var(--hub-ease);
}
.twl-hub-why__item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(255,106,0,0.08);
}
.twl-hub-why__item strong {
  color: var(--hub-accent);
  display: block;
  margin-bottom: .5rem;
  font-size: 1rem;
}
.twl-hub-why__item p { color: #555; font-size: .9rem; margin: 0; line-height: 1.6; }

/* ── FAQ (light — DC style) ── */
.twl-hub-faq { padding: var(--hub-space-section) 0; }
.twl-hub-faq,
.twl-hub-faq * { color: #1a1a1a; }
.twl-hub-faq h2 {
  text-align: center;
  color: #1a1a1a !important;
  margin-bottom: 0;
}
.twl-hub-faq__list {
  max-width: 800px;
  margin: 2.5rem auto 0;
}
.twl-hub-faq__item {
  border-bottom: 1px solid rgba(0,0,0,0.08) !important;
  background: none !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 0;
}
button.twl-hub-faq__header,
.twl-hub-faq__header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 1.25rem 0 !important;
  width: 100% !important;
  background: none !important;
  background-color: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  cursor: pointer;
  text-align: left;
  gap: 1rem !important;
  margin: 0 !important;
  line-height: 1.5 !important;
  font-weight: 600;
  font-size: 1rem;
  color: #1a1a1a !important;
  transition: color .2s;
}
button.twl-hub-faq__header:hover,
button.twl-hub-faq__header:focus {
  background: none !important;
  background-color: transparent !important;
  box-shadow: none !important;
  color: var(--hub-accent) !important;
}
.twl-hub-faq__num {
  font-family: 'JetBrains Mono', 'SF Mono', monospace !important;
  font-size: 0.65rem !important;
  color: rgba(0,0,0,0.35) !important;
  margin-right: 1rem;
  flex-shrink: 0;
}
.twl-hub-faq__q {
  flex: 1;
  color: #1a1a1a !important;
}
.twl-hub-faq__toggle {
  font-family: 'JetBrains Mono', 'SF Mono', monospace !important;
  font-size: 1.2rem !important;
  color: var(--hub-accent) !important;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: none !important;
  border: none !important;
  transition: transform .35s var(--hub-ease);
}
.twl-hub-faq__item.is-open .twl-hub-faq__toggle {
  transform: rotate(45deg);
}
.twl-hub-faq__body {
  height: 0;
  overflow: hidden;
  background: none !important;
  transition: height .35s var(--hub-ease);
}
.twl-hub-faq__body p {
  padding: 0 0 1.25rem !important;
  font-size: clamp(0.85rem, 1.2vw, 0.95rem) !important;
  color: #555 !important;
  line-height: 1.7 !important;
  margin: 0;
}
.twl-hub-faq__body p a { color: var(--hub-accent) !important; text-decoration: underline; }

/* ── Section titles (green-box pattern) ── */
.twl-servicios-hub .section-title-vc {
  text-align: center !important;
  white-space: normal;
}
.twl-hub-section--light .section-title-vc {
  color: #1a1a1a !important;
}
.twl-hub-section--dark .section-title-vc {
  color: #fff !important;
}
.twl-servicios-hub .section-title-vc .green-box {
  background: var(--hub-accent) !important;
}
.twl-hub-category__title.section-title-vc {
  margin: 0 0 .5rem;
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
}

/* Fix 3 — Center reveal titles & subtitles */
.twl-servicios-hub .twl-hub-reveal { text-align: center; }
.twl-servicios-hub .twl-process-subtitle { text-align: center; }

/* Fix — Remove all dark-section bottom dividers */
.twl-servicios-hub .twl-hub-section--dark::after { display: none; }

/* ── Scroll reveal (GSAP-driven) ── */

/* ── Responsive ── */
@media (max-width: 768px) {
  .twl-hub-grid { grid-template-columns: 1fr; }
  .twl-hub-why__grid { grid-template-columns: 1fr; }
  .twl-hub-crosslinks__grid { grid-template-columns: 1fr; }
  .twl-hub-intro__details { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .twl-hub-reveal,
  .twl-hub-reveal-stagger > *,
  .twl-hub-card {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .twl-hub-faq__panel { transition: none; }
  .twl-hub-card { transition: none; }
}

/* ── Fix: barra negra debajo del header ── */
.page-template-page-templatestwl-servicios-hub-php .top_panel_title {
  display: none !important;
}

/* ── Fix: remove sidebar completely ── */
.page-template-page-templatestwl-servicios-hub-php .sidebar,
.page-template-page-templatestwl-servicios-hub-php aside,
.page-template-page-templatestwl-servicios-hub-php [role="complementary"]:not([aria-label]),
.page-template-page-templatestwl-servicios-hub-php .widget_area,
.page-template-page-templatestwl-servicios-hub-php .sidebar_inner,
body.twl-no-sidebar .sidebar,
body.twl-no-sidebar aside.sidebar,
body.twl-no-sidebar .widget_area {
  display: none !important;
}
.page-template-page-templatestwl-servicios-hub-php .content_wrap,
.page-template-page-templatestwl-servicios-hub-php .page_content_wrap .content_wrap,
.page-template-page-templatestwl-servicios-hub-php .content,
.page-template-page-templatestwl-servicios-hub-php .content_wrap > .content,
body.twl-no-sidebar .content_wrap,
body.twl-no-sidebar .content {
  width: 100% !important;
  max-width: 100% !important;
  float: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
body.twl-no-sidebar .page_content_wrap {
  padding: 0 !important;
}

/* ── Fix: prevent mediaelement player inside cards ── */
.twl-hub-card .mejs-container,
.twl-hub-card .wp-video,
.twl-hub-card .mejs-overlay,
.twl-hub-card .mejs-layers,
.twl-hub-card .mejs-controls {
  display: none !important;
}
.twl-hub-card video.twl-hub-card__video,
.twl-hub-card .wp-video video,
.twl-hub-card .mejs-container video {
  display: block !important;
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  z-index: 0 !important;
}

/* ── Fix: centrar títulos Descubre más / Por qué ── */
.twl-hub-crosslinks h2,
.twl-hub-why h2 {
  text-align: center !important;
  width: 100%;
}
.twl-hub-crosslinks .twl-hub-reveal,
.twl-hub-why .twl-hub-reveal {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── Fix: quitar barra que divide footer de sección anterior ── */
.twl-servicios-hub .twl-cta {
  border-bottom: none;
}
.page-template-page-templatestwl-servicios-hub-php .footer_wrap.footer_custom::before,
.page-template-page-templatestwl-servicios-hub-php footer.footer_wrap.footer_custom::before {
  display: none !important;
}
