/**
 * TKM Base Theme — tokens puente + utilidades compartidas.
 *
 * Las variables --tkm-* estan sincronizadas 1:1 con los presets de theme.json.
 * Los packs SOLO consumen --tkm-* y presets WP. Prohibido hardcodear colores.
 */

:root {
  --tkm-primary: #1E40AF;
  --tkm-navy: #0E1E3A;
  --tkm-cyan: #06B6D4;
  --tkm-bg: #FFFFFF;
  --tkm-surface: #F1F5F9;
  --tkm-text: #0F172A;
  --tkm-muted: #64748B;
  --tkm-font-head: "Sora", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --tkm-font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --tkm-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* Utilidades compartidas tkm-* */
.tkm-container {
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.tkm-hero {
  padding-block: clamp(4rem, 8vw, 6rem);
}

.tkm-section {
  padding-block: clamp(2.5rem, 5vw, 4rem);
}

.tkm-grid-2 {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .tkm-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.tkm-grid-3 {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .tkm-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.tkm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-family: var(--tkm-font-head);
  font-weight: 600;
  text-decoration: none;
}

.tkm-btn-primary {
  background: var(--tkm-primary);
  color: #fff;
}

.tkm-btn-outline {
  border: 1px solid var(--tkm-primary);
  color: var(--tkm-primary);
  background: transparent;
}

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

.tkm-glass {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(226, 232, 240, 0.6);
}

/* ---------------------------------------------------------------------------
 * Chrome del chasis (TKM 2.0): header + navegacion horizontal profesional.
 * Estilo por defecto: "glass" (fijo, oscuro, blur). Variantes via body_class
 * tkm-menu-{glass|inline|minimal} — configurable en el panel (Identidad).
 * ------------------------------------------------------------------------- */
.tkm-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(11, 17, 32, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.08);
}

.tkm-header .tkm-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 64px;
}

.tkm-main {
  padding-top: 64px; /* compensa el header fijo del estilo glass */
}

.tkm-brand,
.custom-logo-link {
  color: #fff;
  font-family: var(--tkm-font-head);
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  letter-spacing: 0.04em;
}

.tkm-header .custom-logo {
  max-height: 40px;
  width: auto;
}

.tkm-nav ul,
.tkm-nav ul.menu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.tkm-nav li {
  margin: 0;
}

.tkm-nav a {
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: color 0.2s ease;
  white-space: nowrap;
}

.tkm-nav a:hover,
.tkm-nav .current-menu-item > a,
.tkm-nav .current_page_item > a {
  color: var(--tkm-cyan);
}

/* Variante: en flujo (transparente, acompana el contenido) */
.tkm-menu-inline .tkm-header {
  position: static;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: none;
}
.tkm-menu-inline .tkm-main {
  padding-top: 0;
}

/* Variante: solido simple */
.tkm-menu-minimal .tkm-header {
  position: static;
  background: var(--tkm-navy);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.tkm-menu-minimal .tkm-main {
  padding-top: 0;
}

@media (max-width: 782px) {
  .tkm-header .tkm-container {
    flex-direction: column;
    align-items: flex-start;
    padding-block: 0.75rem;
  }
  .tkm-nav ul,
  .tkm-nav ul.menu {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }
}

/* Admin bar de WP: el margin-top que aplica core NO mueve los elementos
 * fixed — el header debe bajar explicitamente para no quedar debajo de la barra. */
body.admin-bar .tkm-header {
  top: 32px;
}

body.admin-bar .tkm-main {
  padding-top: calc(64px + 32px);
}

@media (max-width: 782px) {
  body.admin-bar .tkm-header {
    top: 46px;
  }
  body.admin-bar .tkm-main {
    padding-top: calc(64px + 46px);
  }
}
