/**
 * Cabecera unificada: template-parts/header-blog.php y shortcode [ac_custom_header].
 * Carga global; blog-style.css depende de este archivo para no duplicar reglas.
 *
 * Especificidad con header.navbar para no perder frente a tipografía global de Elementor.
 */
:root {
  --white: #ffffff;
  --red: #e24352;
  --red-light: #ea6070;
  --radius-sm: 7px;
  --radius-pill: 30px;
  --blog-header-bg: #007580;
  --brand-red-accent: #e3000f;
  --blog-header-sticky-h: 80px;
}

/* ══════════════════════════════════════════
   NAVBAR (header-blog)
══════════════════════════════════════════ */
header.navbar {
  background-color: var(--blog-header-bg);
  position: sticky;
  top: 0;
  z-index: 200;
  padding: 0 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

header.navbar .navbar-inner {
  max-width: 1220px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  height: auto;
  padding-top: 8px;
  padding-bottom: 8px;
}

/* Logo Astra (identidad del sitio) */
header.navbar .blog-navbar-branding {
  display: flex;
  align-items: center;
  flex-shrink: 1;
  min-width: 0;
  line-height: 1.2;
}

header.navbar .blog-navbar-branding .site-branding {
  flex-shrink: 0;
  min-width: 0;
  margin: 0;
  padding: 0;
}

header.navbar .blog-navbar-branding .ast-site-identity {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 0;
  padding: 0;
}

header.navbar .blog-navbar-branding .site-logo-img {
  display: flex;
  align-items: center;
  line-height: 0;
}

header.navbar .blog-navbar-branding .custom-logo-link {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  text-decoration: none;
  color: inherit;
}

header.navbar .blog-navbar-branding .custom-logo-link img,
header.navbar .blog-navbar-branding .site-logo-img img {
  max-height: 56px;
  width: auto;
  max-width: none;
  height: auto;
  vertical-align: middle;
}

header.navbar .blog-navbar-branding .site-title {
  margin: 0;
  padding: 0;
  font-size: inherit;
  line-height: 1.2;
}

header.navbar .blog-navbar-branding .site-title a {
  font-family: 'Nunito', sans-serif;
  font-size: 18px;
  font-weight: 500;
  color: #ffffff;
  letter-spacing: -0.02em;
  white-space: nowrap;
  text-decoration: none;
}

header.navbar .blog-navbar-branding .site-title a:hover {
  color: #ffffff;
}

header.navbar .blog-navbar-branding .site-description {
  margin: 0;
  padding: 0;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.3;
  max-width: 220px;
}

header.navbar .blog-navbar-branding .ast-logo-svg-icon {
  display: flex;
  align-items: center;
  line-height: 0;
}

header.navbar .blog-navbar-branding .ast-logo-svg-icon svg {
  max-height: 52px;
  width: auto;
}

header.navbar .blog-navbar-branding a.blog-fallback-logo {
  font-family: 'Nunito', sans-serif;
  font-size: 18px;
  font-weight: 500;
  color: #ffffff;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

header.navbar .nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
}

header.navbar .nav-links > a.nav-link {
  font-family: 'Nunito Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #ffffff;
  padding: 10px 14px 8px;
  border-radius: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
}

header.navbar .nav-links > a.nav-link:hover {
  color: #ffffff;
  background: transparent;
  border-bottom-color: var(--brand-red-accent);
  font-weight: 500;
}

header.navbar .nav-links > a.nav-link.active {
  color: #ffffff;
  background: transparent;
  border-bottom-color: var(--brand-red-accent);
  font-weight: 500;
}

header.navbar .nav-divider {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.22);
  margin: 0 6px;
}

header.navbar .nav-cta {
  background: var(--red);
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
  padding: 9px 20px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
  letter-spacing: 0.01em;
  font-family: 'Nunito Sans', sans-serif;
}

header.navbar .nav-cta:hover {
  background: var(--red-light);
}

header.navbar .mobile-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

header.navbar .mobile-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #ffffff;
  border-radius: 1px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

header.navbar .mobile-toggle.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

header.navbar .mobile-toggle.is-open span:nth-child(2) {
  opacity: 0;
}

header.navbar .mobile-toggle.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 992px) {
  header.navbar .navbar-inner {
    position: relative;
    flex-wrap: nowrap;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
  }

  header.navbar .mobile-toggle {
    display: flex;
    flex-shrink: 0;
    margin-left: 0;
    order: 0;
  }

  header.navbar .navbar-inner .blog-navbar-branding {
    flex: 1;
    min-width: 0;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  header.navbar .navbar-inner .blog-navbar-branding .site-title a {
    font-size: 15px;
    font-weight: 500;
  }

  header.navbar .nav-cta {
    font-size: 12px;
    font-weight: 700;
    padding: 8px 12px;
    flex-shrink: 0;
  }

  header.navbar .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 12px 20px 16px;
    margin: 0;
    background: var(--blog-header-bg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    z-index: 250;
    max-height: min(70vh, 480px);
    overflow-y: auto;
  }

  header.navbar .nav-links.is-open {
    display: flex;
  }

  header.navbar .nav-links > a.nav-link {
    white-space: normal;
    text-align: left;
    font-weight: 500;
  }

  header.navbar .nav-divider {
    display: none;
  }
}

/* Branding compacto: título en texto (sin logo imagen / móvil) */
@media (max-width: 768px) {
  header.navbar .blog-navbar-branding .site-title a {
    font-size: 13px;
    font-weight: 500;
    white-space: normal;
    text-align: center;
    line-height: 1.25;
    max-width: min(100%, 200px);
  }

  header.navbar .blog-navbar-branding .custom-logo-link img,
  header.navbar .blog-navbar-branding .site-logo-img img {
    max-height: 48px;
  }

  header.navbar .blog-navbar-branding .ast-logo-svg-icon svg {
    max-height: 44px;
  }
}
