/* ============================================================
   Noxtel WP — Main CSS
   Variables + reset + componentes compartidos
   Consistente con las landings estáticas de noxtel.mx
   ============================================================ */

:root {
  /* Colores base (consistente con index.html, /data-center/, /agentes-ia/, etc.) */
  --nx-bg-deep:    #0a0f1a;
  --nx-bg-deeper:  #060912;
  --nx-bg-darker:  #080c18;
  --nx-bg-elev-1:  #0f1a2a;
  --nx-bg-elev-2:  #1a2540;
  --nx-bg-light:   #f4f6f9;
  --nx-bg-white:   #ffffff;

  /* Acentos */
  --nx-green:      #71a100;
  --nx-green-wa:   #25d366;
  --nx-orange:     #e25822;
  --nx-orange-deep:#c84a18;
  --nx-red:        #ff7777;
  --nx-blue:       #3282e6;

  /* Texto */
  --nx-text:        #e0e4ec;
  --nx-text-muted:  #b0b8c8;
  --nx-text-dim:    #888;
  --nx-text-dark:   #1a2540;
  --nx-text-dark-2: #555;

  /* Borders */
  --nx-border:      rgba(255, 255, 255, 0.08);
  --nx-border-2:    rgba(255, 255, 255, 0.14);

  /* Spacing */
  --nx-r-sm: 6px;
  --nx-r-md: 8px;
  --nx-r-lg: 12px;
  --nx-r-xl: 16px;

  /* Shadows */
  --nx-shadow-sm: 0 2px 6px rgba(0,0,0,.18);
  --nx-shadow-md: 0 6px 24px rgba(0,0,0,.24);
  --nx-shadow-lg: 0 18px 48px rgba(0,0,0,.36);

  /* Layout */
  --nx-container: 1200px;
  --nx-container-narrow: 760px;

  /* Font (Inter cargada vía Google Fonts en functions.php) */
  --nx-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --nx-font-display: 'Space Grotesk', 'Inter', sans-serif;
}

/* ============================================================
   Editorial Vibe v1.1.0 — Space Grotesk en títulos (alineado con LP)
   Referencia visual: Noxtel LP estática (Inter + Space Grotesk, dark)
   Cambios:
   - Títulos H1/H2/H3 en display sans Space Grotesk (peso 700)
   - Drop caps en .nx-post__content > p:first-of-type (single.php)
   - Pull quotes (.nx-pullquote) en single.php
   - Kickers editoriales (categoria + línea de color)
   - Byline prominente con avatar (single.php)
   - Numeración editorial "01 — Capítulo" (ya existe, refinado)
   NO se hace: rojo news, layout magazine con sidebar, comentarios 作者
   ============================================================ */
h1, h2, h3,
h1 a, h2 a, h3 a,
.nx-blog-hero__title,
.nx-card__title,
.nx-post__title,
.nx-section-heading h2,
.nx-blog-featured__title,
.nx-landing-hero__title,
.nx-page-title {
  font-family: var(--nx-font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.18;
}

h4, h5, h6 {
  font-family: var(--nx-font);
  font-weight: 600;
}

/* ============================================================
   Reset + Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--nx-font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--nx-text);
  background-color: var(--nx-bg-deep);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg, video { max-width: 100%; height: auto; display: block; }

a {
  color: var(--nx-blue);
  text-decoration: none;
  transition: color .2s ease;
}
a:hover { color: var(--nx-text); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--nx-font);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 .6em;
  color: var(--nx-text);
  letter-spacing: -.02em;
}

h1 { font-size: clamp(2rem, 4vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 700; }
h3 { font-size: clamp(1.3rem, 2.2vw, 1.7rem); font-weight: 700; }
h4 { font-size: 1.15rem; font-weight: 600; }

p { margin: 0 0 1em; }

ul, ol { padding-left: 1.4em; }

code, pre {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: .92em;
  background: var(--nx-bg-elev-1);
  padding: .15em .4em;
  border-radius: var(--nx-r-sm);
}
pre { padding: 1em; overflow-x: auto; }

/* ============================================================
   Layout
   ============================================================ */
.nx-container {
  max-width: var(--nx-container);
  margin: 0 auto;
  padding: 0 24px;
}
.nx-container--narrow {
  max-width: var(--nx-container-narrow);
}

/* ============================================================
   Header
   ============================================================ */
.nx-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 15, 26, .92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--nx-border);
}
.nx-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 72px;
  max-width: var(--nx-container);
  margin: 0 auto;
  padding: 0 24px;
}
.nx-header__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--nx-text);
  letter-spacing: -.02em;
}
.nx-header__brand img { height: 36px; width: auto; }
.nx-header__brand-mark {
  display: inline-block;
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--nx-green), var(--nx-orange));
  border-radius: var(--nx-r-md);
  position: relative;
}
.nx-header__brand-mark::after {
  content: '';
  position: absolute;
  inset: 6px;
  background: var(--nx-bg-deep);
  border-radius: 4px;
}
.nx-header__nav { display: flex; gap: 8px; align-items: center; }
.nx-header__nav a {
  color: var(--nx-text-muted);
  font-weight: 500;
  font-size: .94rem;
  padding: 8px 14px;
  border-radius: var(--nx-r-md);
  transition: all .2s ease;
}
.nx-header__nav a:hover {
  color: var(--nx-text);
  background: rgba(255, 255, 255, .04);
}
.nx-header__cta {
  background: var(--nx-green-wa);
  color: var(--nx-bg-white) !important;
  font-weight: 600;
  padding: 10px 18px !important;
  border-radius: var(--nx-r-md);
}
.nx-header__cta:hover {
  background: #20bd5a !important;
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .nx-header__inner { height: 64px; }
  .nx-header__nav { display: none; } /* TODO: mobile menu */
}

/* ============================================================
   Footer
   ============================================================ */
.nx-footer {
  background: var(--nx-bg-darker);
  border-top: 1px solid var(--nx-border);
  padding: 60px 0 30px;
  margin-top: 80px;
}
.nx-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  max-width: var(--nx-container);
  margin: 0 auto;
  padding: 0 24px;
}
@media (max-width: 768px) {
  .nx-footer__grid { grid-template-columns: 1fr 1fr; gap: 30px; }
}
.nx-footer__brand-block p {
  color: var(--nx-text-muted);
  font-size: .92rem;
  line-height: 1.6;
}
.nx-footer__heading {
  color: var(--nx-text);
  font-size: .85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 16px;
}
.nx-footer__links { list-style: none; padding: 0; margin: 0; }
.nx-footer__links li { margin-bottom: 8px; }
.nx-footer__links a {
  color: var(--nx-text-muted);
  font-size: .9rem;
}
.nx-footer__links a:hover { color: var(--nx-text); }
.nx-footer__bottom {
  max-width: var(--nx-container);
  margin: 40px auto 0;
  padding: 24px 24px 0;
  border-top: 1px solid var(--nx-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.nx-footer__bottom p {
  color: var(--nx-text-dim);
  font-size: .85rem;
  margin: 0;
}

/* ============================================================
   Botones
   ============================================================ */
.nx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  font-family: var(--nx-font);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1;
  border: none;
  border-radius: var(--nx-r-md);
  cursor: pointer;
  text-decoration: none;
  transition: all .2s ease;
  letter-spacing: -.01em;
}
.nx-btn--primary {
  background: var(--nx-green);
  color: var(--nx-bg-white);
}
.nx-btn--primary:hover {
  background: #5e8a00;
  color: var(--nx-bg-white);
  transform: translateY(-2px);
  box-shadow: var(--nx-shadow-md);
}
.nx-btn--wa {
  background: var(--nx-green-wa);
  color: var(--nx-bg-white);
}
.nx-btn--wa:hover {
  background: #20bd5a;
  color: var(--nx-bg-white);
  transform: translateY(-2px);
}
.nx-btn--ghost {
  background: transparent;
  color: var(--nx-text);
  border: 1px solid var(--nx-border-2);
}
.nx-btn--ghost:hover {
  background: rgba(255, 255, 255, .04);
  border-color: var(--nx-text-muted);
  color: var(--nx-text);
}
.nx-btn--lg { padding: 18px 36px; font-size: 1.08rem; }

/* ============================================================
   Cards
   ============================================================ */
.nx-card {
  background: var(--nx-bg-elev-1);
  border: 1px solid var(--nx-border);
  border-radius: var(--nx-r-lg);
  overflow: hidden;
  transition: all .25s ease;
}
.nx-card:hover {
  border-color: var(--nx-border-2);
  transform: translateY(-4px);
  box-shadow: var(--nx-shadow-md);
}
.nx-card__media {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--nx-bg-elev-2);
}
.nx-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.nx-card:hover .nx-card__media img { transform: scale(1.04); }
.nx-card__body { padding: 24px; }
.nx-card__meta {
  display: flex;
  gap: 12px;
  font-size: .82rem;
  color: var(--nx-text-dim);
  margin-bottom: 12px;
}
.nx-card__title {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 10px;
}
.nx-card__title a {
  color: var(--nx-text);
}
.nx-card__title a:hover { color: var(--nx-green); }
.nx-card__excerpt {
  color: var(--nx-text-muted);
  font-size: .94rem;
  line-height: 1.55;
  margin: 0;
}

/* ============================================================
   Forms
   ============================================================ */
.nx-form {
  display: grid;
  gap: 16px;
}
.nx-form__row { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
@media (max-width: 600px) { .nx-form__row { grid-template-columns: 1fr; } }
.nx-form label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--nx-text-muted);
  margin-bottom: 6px;
}
.nx-form input,
.nx-form textarea,
.nx-form select {
  width: 100%;
  padding: 12px 14px;
  background: var(--nx-bg-darker);
  border: 1px solid var(--nx-border-2);
  border-radius: var(--nx-r-md);
  color: var(--nx-text);
  font-family: var(--nx-font);
  font-size: .96rem;
  transition: border-color .2s ease;
}
.nx-form input:focus,
.nx-form textarea:focus,
.nx-form select:focus {
  outline: none;
  border-color: var(--nx-green);
}
.nx-form textarea { min-height: 120px; resize: vertical; }

/* ============================================================
   Utilities
   ============================================================ */
.nx-text-center { text-align: center; }
.nx-text-muted  { color: var(--nx-text-muted); }
.nx-text-green  { color: var(--nx-green); }
.nx-text-orange { color: var(--nx-orange); }
.nx-mt-0  { margin-top: 0; }
.nx-mb-0  { margin-bottom: 0; }
.nx-mt-1  { margin-top: 8px; }
.nx-mb-1  { margin-bottom: 8px; }
.nx-mt-2  { margin-top: 16px; }
.nx-mb-2  { margin-bottom: 16px; }
.nx-mt-3  { margin-top: 24px; }
.nx-mb-3  { margin-bottom: 24px; }
.nx-mt-4  { margin-top: 32px; }
.nx-mb-4  { margin-bottom: 32px; }
.nx-mt-5  { margin-top: 48px; }
.nx-mb-5  { margin-bottom: 48px; }

.nx-section { padding: 80px 0; }
@media (max-width: 768px) { .nx-section { padding: 50px 0; } }

.nx-divider {
  height: 1px;
  background: var(--nx-border);
  margin: 40px 0;
}

/* Screen reader only */
.nx-sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Skip link accesible */
.nx-skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--nx-green);
  color: var(--nx-bg-white);
  padding: 8px 16px;
  z-index: 100;
}
.nx-skip-link:focus { top: 0; }

/* ============================================================
   Logo filter — v1.1.1
   El custom logo configurado en WP Admin apunta a un PNG negro.
   Invertimos colores para que se vea blanco sobre fondo oscuro.
   Funciona con PNG, SVG o cualquier formato.
   ============================================================ */
.nx-header__brand img,
.nx-header__logo-svg,
.custom-logo {
  filter: brightness(0) invert(1);
  max-height: 40px;
  width: auto;
}

/* Si en el futuro el custom logo es ya blanco/claro, se puede sobrescribir
   con .nx-header__brand img { filter: none; } en una variante de tema. */

/* ============================================================
   Hamburger menu (mobile) — v1.1.0
   ============================================================ */
.nx-header__hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 22px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nx-header__hamburger-bar {
  width: 100%;
  height: 2px;
  background: var(--nx-text, #e0e4ec);
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nx-header__hamburger[aria-expanded="true"] .nx-header__hamburger-bar:nth-child(1) {
  transform: translateY(10px) rotate(45deg);
}
.nx-header__hamburger[aria-expanded="true"] .nx-header__hamburger-bar:nth-child(2) {
  opacity: 0;
}
.nx-header__hamburger[aria-expanded="true"] .nx-header__hamburger-bar:nth-child(3) {
  transform: translateY(-10px) rotate(-45deg);
}

@media (max-width: 768px) {
  .nx-header__hamburger {
    display: flex;
  }

  .nx-header__nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--nx-bg-elev-1, #0f1a2a);
    padding: 1rem;
    border-bottom: 1px solid var(--nx-border, rgba(255,255,255,0.08));
    gap: 0.75rem;
  }

  .nx-header__nav.is-open {
    display: flex;
  }

  .nx-header__nav a {
    padding: 0.5rem 0;
  }

  .nx-header__cta {
    margin-top: 0.5rem;
  }
}
