/*
Theme Name: i4e
Theme URI: https://i4e.site
Author: i4e — Intelligence 4 Everyone
Description: Tema a medida para i4e.site — Diseño Estratégico Asistido. One-page oscuro con acento esmeralda, 14 secciones y blog nativo.
Version: 1.0.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: i4e
*/

:root {
  --bg: #0A0B0A;
  --panel: #111311;
  --accent: #4ADE80;
  --text: #F2F5F2;
  --muted: #9BA69E;
  --border: rgba(242, 245, 242, 0.08);
  --font-head: "DM Sans", sans-serif;
  --font-body: "Inter", sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.12;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}

p { margin: 0 0 1rem; }

.container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }

/* ---------- Nav ---------- */

.site-nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  background: rgba(10, 11, 10, 0.72);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.site-nav.scrolled {
  background: rgba(10, 11, 10, 0.92);
  border-bottom-color: var(--border);
}

.site-nav .container {
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 68px;
  max-width: 1360px;
}

.brand {
  display: flex;
  align-items: center;
  margin-right: auto;
  line-height: 0;
}

.brand img {
  height: 34px;
  width: auto;
  display: block;
}

.brand:hover { text-decoration: none; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--text);
  font-size: 0.92rem;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.nav-links a:not(.btn) { position: relative; }

.nav-links a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s ease;
}

.nav-links a:not(.btn):hover { color: var(--accent); text-decoration: none; }
.nav-links a:not(.btn):hover::after { transform: scaleX(1); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 11px;
  cursor: pointer;
}

.nav-toggle .bars,
.nav-toggle .bars::before,
.nav-toggle .bars::after {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.nav-toggle .bars { position: relative; }
.nav-toggle .bars::before,
.nav-toggle .bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle .bars::before { top: -6px; }
.nav-toggle .bars::after { top: 6px; }

.nav-toggle[aria-expanded="true"] .bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bars::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Botones ---------- */

.btn {
  display: inline-block;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1rem;
  padding: 16px 32px;
  border-radius: 999px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover { text-decoration: none; transform: translateY(-1px); }

.btn { white-space: nowrap; }

.btn-primary {
  background: var(--accent);
  color: #06240f;
  box-shadow: 0 0 32px rgba(74, 222, 128, 0.25);
}

.btn-primary:hover { box-shadow: 0 0 48px rgba(74, 222, 128, 0.4); }

.btn-ghost {
  border: 1px solid var(--border);
  color: var(--text);
  background: rgba(242, 245, 242, 0.02);
}

.nav-links .btn { padding: 12px 24px; font-size: 0.95rem; }

/* ---------- Secciones ---------- */

.section { padding: 110px 0; }

.kicker {
  font-family: var(--font-head);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  margin-bottom: 1.4rem;
}

.section h2 {
  font-size: clamp(2.1rem, 4.5vw, 3.4rem);
  max-width: 21ch;
}

.section .lead {
  color: var(--muted);
  font-size: 1.15rem;
  max-width: 62ch;
}

.center { text-align: center; }
.center h2, .center .lead { margin-left: auto; margin-right: auto; }
.center .kicker { margin-left: auto; margin-right: auto; }

.muted { color: var(--muted); }
.accent { color: var(--accent); }

.glow {
  color: var(--accent);
  text-shadow: 0 0 70px rgba(74, 222, 128, 0.6);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 200px 0 140px;
  text-align: center;
  background:
    radial-gradient(ellipse 50% 40% at 50% 55%, rgba(74, 222, 128, 0.08), transparent 70%),
    var(--bg);
}

.hero::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 54%;
  width: 62%;
  height: 55%;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at center, rgba(74, 222, 128, 0.12), transparent 62%);
  pointer-events: none;
  z-index: 0;
}

.hero > .container { position: relative; z-index: 1; }

.hero h1 {
  font-size: clamp(2.6rem, 6.5vw, 4.6rem);
  max-width: 18ch;
  margin: 0 auto 1.6rem;
}

.hero .lead {
  color: var(--muted);
  font-size: 1.2rem;
  max-width: 58ch;
  margin: 0 auto 2.6rem;
}

.hero-ctas { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }

/* ---------- Tarjetas ---------- */

.cards {
  display: grid;
  gap: 24px;
  margin-top: 3rem;
}

.cards-3 { grid-template-columns: repeat(3, 1fr); }
.cards-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  position: relative;
  background:
    radial-gradient(ellipse 80% 60% at 80% 0%, rgba(74, 222, 128, 0.05), transparent 70%),
    var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 34px 30px;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(74, 222, 128, 0.28);
  box-shadow: 0 18px 40px -24px rgba(74, 222, 128, 0.35);
}

.card h3 { font-size: 1.35rem; margin-bottom: 0.8rem; }
.card p { color: var(--muted); margin-bottom: 0; font-size: 1rem; }
.card p + p { margin-top: 0.8rem; }

.card .num {
  font-family: var(--font-head);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.22em;
  display: block;
  margin-bottom: 1.6rem;
}


/* Stats */

.stat .big {
  font-family: var(--font-head);
  color: var(--accent);
  font-weight: 700;
  font-size: 3.6rem;
  line-height: 1;
  display: block;
  margin-bottom: 1rem;
}

.stat .big small { font-size: 1.8rem; }

/* Quotes pills */

.quotes { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 2.6rem; }

.quotes span {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 24px;
  color: var(--muted);
  font-style: italic;
  font-size: 1rem;
}

/* Banner principio rector */

.banner {
  margin-top: 3rem;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 70px 30px;
  background:
    radial-gradient(ellipse 60% 80% at 50% 100%, rgba(74, 222, 128, 0.09), transparent 70%),
    var(--panel);
}

.banner .phrase {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(1.9rem, 4vw, 3rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 1rem;
  color: var(--muted);
}

.banner .phrase .accent { text-shadow: 0 0 60px rgba(74, 222, 128, 0.5); }

/* ---------- Layout dos columnas (Jonaz / Copo) ---------- */

.split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 70px;
  align-items: center;
}

.split .lead { font-size: 1.15rem; }

/* ---------- Foto de Copo (Nosotros) ---------- */

.copo-foto {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 22px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(74, 222, 128, 0.10), transparent 70%),
    var(--panel);
  line-height: 0;
}

.copo-foto img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 18%;
  opacity: 0.94;
  transition: opacity 0.3s ease;
}

.copo-foto:hover img { opacity: 1; }

/* ---------- Método (lista numerada) ---------- */

.steps { display: grid; gap: 18px; margin-top: 3rem; max-width: 840px; }

.step {
  display: flex;
  gap: 24px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 30px;
}

.step .n {
  flex: 0 0 44px;
  height: 44px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
  font-family: var(--font-head);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step {
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.step:hover { transform: translateX(6px); border-color: rgba(74, 222, 128, 0.28); }

.step h3 { font-size: 1.25rem; margin-bottom: 0.4rem; }
.step p { color: var(--muted); margin: 0; }

/* ---------- Tabla investigación ---------- */

.table-wrap { overflow-x: auto; margin-top: 3rem; }

table.compare {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  min-width: 640px;
}

.compare th, .compare td {
  padding: 20px 24px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  font-size: 1rem;
}

.compare thead th {
  font-family: var(--font-head);
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.compare thead th:last-child { color: var(--accent); }
.compare tbody th { color: var(--text); font-weight: 600; width: 22%; }
.compare td { color: var(--muted); }
.compare tbody tr:last-child th, .compare tbody tr:last-child td { border-bottom: none; }

/* ---------- Modelo ---------- */

.quote-block {
  margin: 3rem auto 0;
  max-width: 640px;
  border-left: 3px solid var(--accent);
  padding-left: 28px;
}

.quote-block p {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.7rem;
  line-height: 1.35;
  margin: 0;
}

/* ---------- Testimonios ---------- */

/* Carrusel con difuminado en los extremos (efecto premium). */
.tcarousel {
  display: flex;
  align-items: stretch; /* todas las tarjetas a la misma altura */
  gap: 24px;
  margin-top: 3rem;
  padding: 6px 4px 22px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%);
}

.tcarousel::-webkit-scrollbar { display: none; }

.tcarousel .card {
  flex: 0 0 360px;
  display: flex;
  flex-direction: column;
}

/* Encabezado de la tarjeta: estrellas + logo de la empresa. */
.testimonial .thead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 30px;
}

.testimonial .stars { color: #F5C518; letter-spacing: 2px; font-size: 1.05rem; }

.testimonial .colog {
  max-height: 26px;
  max-width: 116px;
  width: auto;
  height: auto;
  opacity: 0.55;
  transition: opacity 0.25s ease;
}

.card:hover .colog { opacity: 0.9; }

.testimonial blockquote {
  margin: 1.2rem 0 1rem;
  font-style: italic;
  color: var(--text);
  min-height: 8.25em; /* 5 líneas: alinea el pie de todas las tarjetas */
}

/* Clamp a 5 líneas hasta que se pulse "Leer más". */
.testimonial blockquote.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.testimonial .readmore {
  align-self: flex-start;
  background: none;
  border: none;
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  margin: 0 0 1.2rem;
}

.testimonial .readmore:hover { text-decoration: underline; }

.testimonial .who {
  border-top: 1px solid var(--border);
  padding-top: 1.2rem;
  margin: auto 0 0;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.95rem;
  min-height: 5rem; /* el divisor queda a la misma altura en todas las tarjetas */
}

.testimonial .avatar img {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: #0d0f0d;
  box-shadow: 0 0 0 1px var(--border);
}

.testimonial .who-text { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.testimonial .who-text strong {
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.testimonial .who-text .role {
  color: var(--muted);
  font-size: 0.86rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.testimonial .li-link { margin-left: auto; color: #4a9fe0; display: flex; }
.testimonial .li-link:hover { color: var(--accent); }

@media (max-width: 860px) {
  .tcarousel .card { flex-basis: 84%; }
}

/* ---------- Blog ---------- */

.post-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }

.post-card .thumb {
  display: block;
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(ellipse 70% 90% at 60% 40%, rgba(74, 222, 128, 0.12), transparent 70%),
    var(--panel);
  border-bottom: 1px solid var(--border);
}

.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-card .body { padding: 26px 28px 30px; }
.post-card .cat { font-family: var(--font-head); color: var(--accent); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; }
.post-card h3 { font-size: 1.3rem; margin: 0.7rem 0 0.6rem; }
.post-card h3 a { color: var(--text); }
.post-card .excerpt { color: var(--muted); font-size: 0.98rem; margin: 0; }

/* ---------- CTA final ---------- */

.cta-final {
  text-align: center;
  padding: 150px 0 160px;
  background: linear-gradient(180deg, var(--bg) 0%, #0c1a10 78%, #102817 100%);
}

.cta-final h2 { max-width: 16ch; margin-left: auto; margin-right: auto; }
.cta-final .lead { margin: 0 auto 2.6rem; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 54px 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer .container { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between; }
.foot-brand { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.foot-brand img { height: 26px; width: auto; display: block; }
.foot-brand span { color: var(--muted); }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }

/* ---------- Elementor ---------- */

/* El contenido de Elementor se dibuja solo: se le deja el ancho completo,
   con espacio arriba para no quedar bajo la barra fija. */
.i4e-elementor .elementor { padding-top: 68px; }
.i4e-elementor .elementor-section.elementor-section-boxed > .elementor-container { max-width: 1160px; }

/* ---------- Blog interior (archive/single/page) ---------- */

.page-shell { padding: 160px 0 110px; }
.page-shell .container { max-width: 820px; }

.entry-title { font-size: clamp(2.2rem, 5vw, 3.2rem); }
.entry-meta { color: var(--muted); font-size: 0.92rem; margin-bottom: 2.4rem; }

.entry-content { color: var(--text); }
.entry-content p, .entry-content li { color: #cdd5cf; }
.entry-content h2, .entry-content h3 { margin-top: 2.4rem; }
.entry-content img { border-radius: 14px; }
.entry-content blockquote { border-left: 3px solid var(--accent); margin: 2rem 0; padding-left: 24px; font-style: italic; color: var(--muted); }

.archive-list { display: grid; gap: 24px; margin-top: 3rem; }

.pagination { margin-top: 3rem; display: flex; gap: 12px; }
.pagination .page-numbers { border: 1px solid var(--border); border-radius: 10px; padding: 8px 16px; color: var(--muted); }
.pagination .page-numbers.current { color: var(--accent); border-color: var(--accent); }

/* ---------- Responsive ---------- */

@media (max-width: 1180px) {
  .brand .tag { display: none; }
}

@media (max-width: 1024px) {
  .cards-3 { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: 1fr; gap: 44px; }
}

@media (max-width: 980px) {
  .section { padding: 80px 0; }
  .hero { padding: 150px 0 100px; }
  .cards-3, .cards-2 { grid-template-columns: 1fr; }
  .brand .tag { display: none; }

  .nav-toggle { display: block; }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(10, 11, 10, 0.97);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px 24px;
  }

  .nav-links.open { display: flex; }
  .nav-links li { padding: 12px 0; border-bottom: 1px solid var(--border); }
  .nav-links li:last-child { border-bottom: none; padding-top: 20px; }
  .nav-links .btn { display: block; text-align: center; }
}

/* ---------- Animaciones ---------- */

@media (prefers-reduced-motion: no-preference) {
  .has-js .hero .kicker,
  .has-js .hero h1,
  .has-js .hero .lead,
  .has-js .hero-ctas,
  .has-js .section .kicker,
  .has-js .section h2,
  .has-js .section .lead,
  .has-js .card:not(.testimonial),
  .has-js .step,
  .has-js .banner,
  .has-js .quote-block,
  .has-js .table-wrap,
  .has-js .quotes span {
    opacity: 0;
    translate: 0 26px;
    transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1), translate 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  }

  .has-js .is-in { opacity: 1 !important; translate: 0 0 !important; }

  .hero::after { animation: heroGlow 7s ease-in-out infinite; }

  @keyframes heroGlow {
    0%, 100% { opacity: 0.55; transform: translate(-50%, -50%) scale(1); }
    50%      { opacity: 1;    transform: translate(-50%, -50%) scale(1.14); }
  }
}
