/*
Theme Name: A2 Big Data
Theme URI: https://a2bigdata.com.mx/
Author: A2 Big Data
Author URI: https://a2bigdata.com.mx/
Description: Tema corporativo de A2 Big Data. Ciencia de datos, IA aplicada y datos geoespaciales. Paleta blanco hueso + azul profundo + coral. Modo oscuro automático con toggle manual. Sin dependencias de plugins para funcionar.
Version: 1.1.13
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: Propietario — uso exclusivo del cliente
License URI: https://a2bigdata.com.mx/
Text Domain: a2bd
Tags: business, portfolio, custom-colors, custom-menu, dark-mode, responsive, accessibility-ready
*/

/* Nota: los estilos reales se cargan desde assets/css/tokens.css, base.css y components.css
   vía wp_enqueue_style() en functions.php. Este archivo sólo contiene el header del theme
   (requerido por WordPress) y pequeñas correcciones para la barra de admin y bloques nativos. */

/* ---------- WordPress admin bar compatibility ---------- */
.admin-bar .site-header { top: 32px; }
@media screen and (max-width: 782px) {
  .admin-bar .site-header { top: 46px; }
}

/* ---------- Alineaciones WP (por si se usan bloques en páginas internas) ---------- */
.alignleft  { float: left;  margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.alignwide { max-width: 1100px; margin-inline: auto; }
.alignfull { width: 100vw; margin-inline: calc(50% - 50vw); }

/* ---------- Gallery / caption ---------- */
.wp-caption { max-width: 100%; margin-bottom: 1.5em; }
.wp-caption-text {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--fg-faint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 8px;
}

/* ---------- Comentarios (oculto por defecto; tema B2B sin comentarios) ---------- */
.comments-area { display: none; }

/* ---------- Language toggle (ES/EN) ---------- */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease);
}
.lang-toggle:hover { background: var(--bg-elev); border-color: var(--border-strong); }

/* ============================================================
   Hero — animación de explosión y retorno
   Los 4 cuadrantes del logo explotan hacia afuera con rotación caótica,
   luego regresan al centro exactamente donde pertenecen.
   Metáfora: el caos de datos se ordena con A2.
   ============================================================ */
.a2bd-logo-pieces .a2bd-piece {
  transform-box: fill-box;
  transform-origin: 280px 280px;
  transition: transform 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* En hover (o focus) sobre la figura, cada pieza corre su propia animación */
.hero__figure:hover .a2bd-piece--n,
.hero__figure:focus-within .a2bd-piece--n {
  animation: a2bd-explode-n 1100ms cubic-bezier(0.5, 0, 0.4, 1) forwards;
}
.hero__figure:hover .a2bd-piece--e,
.hero__figure:focus-within .a2bd-piece--e {
  animation: a2bd-explode-e 1100ms cubic-bezier(0.5, 0, 0.4, 1) forwards;
  animation-delay: 40ms;
}
.hero__figure:hover .a2bd-piece--s,
.hero__figure:focus-within .a2bd-piece--s {
  animation: a2bd-explode-s 1100ms cubic-bezier(0.5, 0, 0.4, 1) forwards;
  animation-delay: 20ms;
}
.hero__figure:hover .a2bd-piece--w,
.hero__figure:focus-within .a2bd-piece--w {
  animation: a2bd-explode-w 1100ms cubic-bezier(0.5, 0, 0.4, 1) forwards;
  animation-delay: 60ms;
}

/* Cada cuadrante vuela en su dirección cardinal + un poco de rotación caótica,
   luego regresa a la posición original. */
@keyframes a2bd-explode-n {
  0%   { transform: translate(0, 0) rotate(0); }
  40%  { transform: translate(-6px, -60px) rotate(-6deg); }
  55%  { transform: translate(3px, -55px) rotate(4deg); }
  75%  { transform: translate(-1px, -18px) rotate(1deg); }
  100% { transform: translate(0, 0) rotate(0); }
}
@keyframes a2bd-explode-e {
  0%   { transform: translate(0, 0) rotate(0); }
  40%  { transform: translate(60px, 6px) rotate(6deg); }
  55%  { transform: translate(55px, -3px) rotate(-4deg); }
  75%  { transform: translate(18px, 1px) rotate(-1deg); }
  100% { transform: translate(0, 0) rotate(0); }
}
@keyframes a2bd-explode-s {
  0%   { transform: translate(0, 0) rotate(0); }
  40%  { transform: translate(6px, 60px) rotate(4deg); }
  55%  { transform: translate(-3px, 55px) rotate(-6deg); }
  75%  { transform: translate(1px, 18px) rotate(-1deg); }
  100% { transform: translate(0, 0) rotate(0); }
}
@keyframes a2bd-explode-w {
  0%   { transform: translate(0, 0) rotate(0); }
  40%  { transform: translate(-60px, -6px) rotate(-4deg); }
  55%  { transform: translate(-55px, 3px) rotate(6deg); }
  75%  { transform: translate(-18px, -1px) rotate(1deg); }
  100% { transform: translate(0, 0) rotate(0); }
}

/* Caption: respiro completo debajo del logo, sin truncar el A²
   (dejamos que haga wrap si en mobile se necesita). */
.hero__caption {
  bottom: -56px;
  padding: 0;
  max-width: 100%;
  white-space: normal;
  line-height: 1.5;
}
@media (max-width: 720px) {
  .hero__caption {
    bottom: -54px;
    font-size: 10px;
  }
}

/* ============================================================
   Section mark — logo pequeño al lado opuesto del heading h2,
   con la misma animación caos→orden al hover.
   ============================================================ */
.section-head {
  position: relative;
}
.section-mark {
  position: absolute;
  top: 0;
  right: 0;
  width: 44px;
  height: 44px;
  opacity: 0.55;
  transform-origin: center;
  transition: opacity 400ms var(--ease), transform 400ms var(--ease);
  pointer-events: auto;
}
.section-mark svg { width: 100%; height: 100%; display: block; }
.section-head:hover .section-mark,
.section-mark:hover {
  opacity: 1;
  animation: a2bd-mark-settle 1000ms cubic-bezier(0.2, 0.85, 0.2, 1) forwards;
}
@keyframes a2bd-mark-settle {
  0%   { opacity: 1; transform: translate(0,0) scale(1); }
  12%  { opacity: 1; transform: translate(-3px, 2px) scale(1.02) rotate(-3deg); }
  26%  { opacity: 1; transform: translate(3px, -3px) scale(1.04) rotate(4deg); }
  42%  { opacity: 1; transform: translate(-2px, 3px) scale(0.99) rotate(-2deg); }
  60%  { opacity: 1; transform: translate(1px, -1px) scale(1.03) rotate(1deg); }
  80%  { opacity: 1; transform: translate(0, 0)   scale(1.05); }
  100% { opacity: 1; transform: translate(0, 0)   scale(1.08); }
}
@media (max-width: 640px) {
  .section-mark { width: 32px; height: 32px; top: -4px; }
}
@media (prefers-reduced-motion: reduce) {
  .a2bd-hero-logo-img, .section-mark {
    animation: none !important; opacity: 1; transform: none !important;
  }
}

/* ---------- Contact card (estática, sin email, sólo nombre) ---------- */
.contact-card--static {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  cursor: default;
}
.contact-card__role {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-faint);
}

/* ---------- Email reveal (anti-scrape) ---------- */
.email-reveal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--fg);
  cursor: pointer;
  background: transparent;
  transition: border-color var(--t) var(--ease), background var(--t) var(--ease);
}
.email-reveal:hover { background: var(--bg-elev); border-color: var(--accent); }
.email-reveal::before { content: "✉"; color: var(--accent); }

/* ---------- Screen reader helper (WP estándar) ---------- */
.screen-reader-text {
  clip: rect(1px, 1px, 1px, 1px);
  position: absolute !important;
  height: 1px; width: 1px;
  overflow: hidden; word-wrap: normal !important;
}
.screen-reader-text:focus {
  background-color: var(--bg-elev);
  border-radius: var(--radius);
  clip: auto !important;
  color: var(--fg);
  display: block;
  font-size: var(--fs-sm);
  font-weight: 700;
  height: auto;
  left: 5px;
  line-height: normal;
  padding: 12px 18px;
  text-decoration: none;
  top: 5px;
  width: auto;
  z-index: 100000;
}
