/*
Theme Name: Astra Child
Theme URI: https://wpastra.com/
Author: Rubén Ramírez Cruz
Template: astra
Version: 1.0.0
Description: Tema hijo personalizado de Astra.
*/

/* =========================================
   ESTILOS PROFESIONALES - TEMA HIJO ASTRA
   ========================================= */

/* ---- BASE ---- */
body {
  background-color: #f8f9fb;
  font-family: 'Inter', 'Open Sans', sans-serif;
  color: #222;
  line-height: 1.7;
}

/* Enlaces generales */
a {
  color: #0f4c81;
  text-decoration: none;
}
a:hover {
  color: #07345b;
  text-decoration: underline;
}

/* =========================================
   CABECERA
   ========================================= */
.site-header,
.ast-primary-header-bar {
  background-color: #0f4c81 !important;
  color: #fff !important;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Enlaces del menú principal */
.main-header-menu a {
  color: #fff !important;
  font-weight: 500;
  padding: 12px 18px;
  transition: all 0.3s ease;
}
.main-header-menu a:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
}

/* Submenús */
.ast-desktop .main-header-menu .sub-menu {
  background-color: #ffffff !important;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}
.ast-desktop .main-header-menu .sub-menu a {
  color: #0f4c81 !important;
  padding: 10px 15px;
}
.ast-desktop .main-header-menu .sub-menu a:hover {
  background-color: #e9f3fb;
}

/* Submenús de segundo nivel: flyout lateral */
.ast-desktop .main-header-menu .sub-menu li.menu-item-has-children { position: relative; }
.ast-desktop .main-header-menu .sub-menu .sub-menu {
  top: 0 !important;                 /* alineado al padre */
  left: calc(100% - 1px) !important; /* solapa 1px: evita huecos de ratón */
  margin-left: 0;                    /* sin separación para no crear gap */
}
/* No añadir icono extra en los submenús (el tema ya lo pone) */
.ast-desktop .main-header-menu .sub-menu > li.menu-item-has-children > a::after {
  content: none !important;
}

/* =========================================
   BREADCRUMBS (MIGAS DE PAN)
   ========================================= */
.ast-breadcrumbs {
  background: transparent !important; /* sin caja */
  padding: 6px 0 !important;
  font-size: 15px;
  border-radius: 0 !important;
  margin: 8px 0 18px 0;
  display: block;
  color: #e7f0fb; /* claro sobre azul oscuro */
  text-shadow: 0 1px 0 rgba(0,0,0,0.15);
}
.ast-breadcrumbs a {
  color: #f3f8ff !important; /* enlaces muy claros */
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px dotted transparent;
  transition: color .2s ease, border-color .2s ease;
}
.ast-breadcrumbs a:hover {
  color: #ffffff !important;
  border-bottom-color: rgba(255,255,255,0.6);
}
.ast-breadcrumbs .breadcrumb-last {
  color: #ffffff !important; /* último tramo destacado */
  font-weight: 900; /* aún más marcado */
  text-decoration: none;
  display: inline-block;       /* permite subrayado decorativo */
  position: relative;
}
.ast-breadcrumbs .breadcrumb-last::after {
  content: "";
  display: block;
  height: 2px;
  width: 100%;
  background: linear-gradient(90deg, rgba(255,255,255,0.95), rgba(255,255,255,0.7));
  border-radius: 2px;
  margin-top: 2px;
}

/* Asegurar negrita del último tramo de las breadcrumbs
   (cubriendo diferentes estructuras usadas por Astra/plugins) */
.ast-breadcrumbs .trail-end,
.ast-breadcrumbs .breadcrumb-last,
.ast-breadcrumbs .breadcrumb_last,
.ast-breadcrumbs .trail-items > li:last-child,
.ast-breadcrumbs .trail-items > li:last-child a,
.ast-breadcrumbs li.breadcrumb-item:last-child,
.ast-breadcrumbs li.breadcrumb-item:last-child a,
.ast-breadcrumbs a[aria-current="page"] {
  font-weight: 900 !important;
  color: #ffffff !important;
  text-decoration: none !important;
}
.ast-breadcrumbs .separator,
.ast-breadcrumbs .sep,
.ast-breadcrumbs .breadcrumb-separator {
  color: #cfe0f2;
  opacity: .9;
}

/* =========================================
   CONTENIDO PRINCIPAL
   ========================================= */
.ast-container {
  background-color: #fff;
  border-radius: 12px;
  padding: 25px;
  margin-top: 25px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

/* =========================================
   FOOTER ELEGANTE Y SOBRIO
   ========================================= */
footer.site-footer {
  background-color: #f1f3f6 !important;
  color: #444 !important;
  text-align: center;
  font-size: 14px;
  padding: 15px 0 !important;
  border-top: 3px solid #0f4c81;
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.05);
}

footer.site-footer a {
  color: #0f4c81 !important;
  font-weight: 500;
}
footer.site-footer a:hover {
  color: #07345b !important;
  text-decoration: underline;
}

.site-below-footer-wrap {
  background-color: transparent !important;
  padding: 0 !important;
  border: none !important;
}

/* =========================================
   DETALLES DE TEXTO Y TITULARES
   ========================================= */
h1, h2, h3, h4 {
  color: #0f4c81;
  font-weight: 600;
  margin-bottom: 15px;
}

/* =========================================
   PEQUEÑOS DETALLES VISUALES
   ========================================= */
button,
input[type="submit"],
.wp-block-button__link {
  background-color: #0f4c81;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 18px;
  transition: background-color 0.3s ease;
}
button:hover,
input[type="submit"]:hover,
.wp-block-button__link:hover {
  background-color: #07345b;
}

/* =========================================
   ARREGLAR VISIBILIDAD DEL MENÚ Y DESPLEGABLES
   - Asegura que la navegación esté por encima del recuadro blanco
   - Fuerza colores legibles y z-index para sub-menús
   ========================================= */

/* Mantener la barra principal en un contexto apilable */
.main-header-bar,
.ast-primary-header-bar,
.site-header {
  position: relative;
  z-index: 20;
}

/* Asegurar que la navegación y sus enlaces estén por encima */
.main-header-bar .main-header-bar-navigation,
.main-header-menu {
  position: relative;
  z-index: 9999;
}

/* Dejar la identidad del sitio (recuadro blanco) por debajo de la navegación */
.site-branding,
.site-title,
.custom-logo-link {
  /* Sin cajas: plano/estirado sobre la barra azul */
  background: transparent !important;
  position: relative;
  z-index: 10;
  padding: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

/* Asegurar que el título/ enlace del sitio mantenga buen contraste */
.site-branding .site-title a,
.site-title a,
.custom-logo-link img {
  color: #0f4c81 !important;
}

/* Evitar que el submenú "cuelgue" desconectado: anclar y alinear */
.ast-primary-header-bar { overflow: visible; }
.ast-primary-header-bar .ast-builder-grid-row { align-items: center; }
.ast-desktop .main-header-menu > .menu-item-has-children { position: relative; }
.ast-desktop .main-header-menu .sub-menu {
  top: 100% !important; /* sin hueco: facilita pasar el cursor */
  left: 0 !important;
}

/* Forzar color de los enlaces del menú principal para contraste */
/* Por petición: los enlaces junto a "Tramites NIE" deben verse oscuros
   (muchos setups de Astra dejan esa zona con fondo claro). */
.ast-primary-header-bar .main-header-menu > li > a,
.main-header-menu > li > a,
.ast-builder-menu-1 .menu-item > a {
  color: #0f4c81 !important; /* azul oscuro legible sobre fondo claro */
}
.ast-primary-header-bar .main-header-menu > li > a:hover,
.main-header-menu > li > a:hover,
.ast-builder-menu-1 .menu-item > a:hover {
  color: #07345b !important;
  background-color: rgba(15, 76, 129, 0.06);
}
.ast-primary-header-bar .main-header-menu > li.current-menu-item > a,
.main-header-menu > li.current-menu-item > a,
.ast-builder-menu-1 .menu-item.current-menu-item > a {
  color: #07345b !important;
  font-weight: 600;
}

/* Iconos/toggles de submenú (flechas) también en azul oscuro */
.main-header-menu .ast-menu-toggle,
.ast-builder-menu-1 .ast-menu-toggle {
  color: #0f4c81 !important;
}

/* Sub-menús deben aparecer siempre por encima y ser legibles */
.ast-desktop .main-header-menu .sub-menu {
  z-index: 99999 !important;
  background-color: #ffffff !important;
}
.ast-desktop .main-header-menu .sub-menu a {
  color: #0f4c81 !important;
}

/* ============================
   Interacción instantánea (hover)
   ============================ */
.ast-desktop .main-header-menu .sub-menu {
  transition: none !important; /* sin animaciones al abrir/cerrar */
  animation: none !important;
}
/* Oculto por defecto y visible solo al hover del padre o del propio panel */
.ast-desktop .main-header-menu > .menu-item > .sub-menu,
.ast-desktop .main-header-menu .sub-menu > li > .sub-menu {
  display: none; opacity: 0; visibility: hidden;
}
.ast-desktop .main-header-menu > .menu-item:hover > .sub-menu,
.ast-desktop .main-header-menu .sub-menu > li:hover > .sub-menu,
.ast-desktop .main-header-menu .sub-menu:hover {
  display: block !important; opacity: 1 !important; visibility: visible !important;
}

/* =========================================
   MENÚ MÓVIL (Astra header break point)
   ========================================= */
/* Colores y contraste del panel móvil */
.ast-header-break-point .main-header-bar-navigation,
.ast-header-break-point .ast-mobile-header-wrap,
.ast-header-break-point .ast-mobile-popup-drawer .ast-mobile-popup-inner {
  background: #ffffff !important;
}

/* Enlaces legibles en móvil */
.ast-header-break-point .main-header-menu a {
  color: #0f4c81 !important;
  padding: 14px 16px !important;
  font-weight: 600;
}
.ast-header-break-point .main-header-menu a:hover,
.ast-header-break-point .main-header-menu a:focus {
  color: #07345b !important;
  background: #e9f3fb !important;
}

/* Toggle/chevrón visibles (hamburguesa en blanco, chevrón de submenú en azul) */
.ast-header-break-point .menu-toggle { /* botón hamburguesa en la barra azul */
  color: #ffffff !important;
}
.ast-header-break-point .menu-toggle:hover,
.ast-header-break-point .menu-toggle:focus {
  color: #ffffff !important;
  opacity: .9;
}
/* Forzar blanco en SVG/íconos de la hamburguesa (todas las variantes) */
.ast-header-break-point .menu-toggle svg,
.ast-header-break-point .menu-toggle svg path,
.ast-header-break-point .menu-toggle svg line,
.ast-header-break-point .menu-toggle .ast-icon,
.ast-header-break-point .menu-toggle .ast-mobile-svg {
  fill: #ffffff !important;
  stroke: #ffffff !important;
  color: #ffffff !important;
}
/* Flechas/toggles dentro del panel del menú móvil */
.ast-header-break-point .main-header-menu .ast-menu-toggle {
  color: #0f4c81 !important;
}

/* Submenús móviles: sin animaciones y apertura instantánea */
.ast-header-break-point .main-header-menu .sub-menu {
  transition: none !important;
  animation: none !important;
  background: #ffffff !important;
  border-left: 2px solid #e9f3fb;
  margin-left: 8px;
}

/* Astra añade la clase ast-submenu-expanded al li cuando se despliega */
.ast-header-break-point .main-header-menu .menu-item-has-children > .sub-menu {
  display: none; opacity: 0; visibility: hidden;
}
.ast-header-break-point .main-header-menu .menu-item-has-children.ast-submenu-expanded > .sub-menu {
  display: block !important; opacity: 1 !important; visibility: visible !important;
}

/* Permitir abrir submenú también al enfocar el enlace o el toggle (mejor usabilidad) */
.ast-header-break-point .main-header-menu .menu-item-has-children:focus-within > .sub-menu,
.ast-header-break-point .main-header-menu .menu-item-has-children > a:focus + .ast-menu-toggle + .sub-menu,
.ast-header-break-point .main-header-menu .menu-item-has-children > .ast-menu-toggle:focus + .sub-menu {
  display: block !important; opacity: 1 !important; visibility: visible !important;
}

/* Ampliar zona táctil del botón de despliegue dentro del panel */
.ast-header-break-point .main-header-menu .ast-menu-toggle {
  width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
}

/* Aumentar área táctil para mejor UX en móvil */
.ast-header-break-point .main-header-menu .menu-item > a { min-height: 44px; align-items: center; display: flex; }

/* Mejorar scroll del panel móvil en dispositivos pequeños */
.ast-header-break-point .ast-mobile-popup-drawer .ast-mobile-popup-inner {
  max-height: 100vh;
  overflow-y: auto;
}

/* ===============================
   🔥 BOTÓN DARK MODE – POSICIÓN + HOVER + TOOLTIP
   =============================== */

.darkmode-layer.darkmode-layer--button,
.darkmode-toggle {
    position: fixed !important;
    bottom: 80px !important;
    right: 40px !important;
    z-index: 999999 !important;
}

/* Estilos base del botón */
.darkmode-toggle {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    background: #ffffff;
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: transform .2s ease, background .2s ease;
}

/* Hover (solo PC) */
.darkmode-toggle:hover {
    transform: scale(1.18);
    background: #eaeaea;
}

/* ===============================
   💬 TOOLTIP: “Modo Oscuro”
   =============================== */
.darkmode-toggle::after {
    content: "Modo Oscuro";
    position: absolute;
    bottom: 120%;
    right: -15px; /* 👉 MÁS A LA DERECHA como pediste */
    font-size: 12px;
    padding: 6px 10px;
    background: #0f4c81;
    color: #fff;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
}

/* Mostrar tooltip SOLO cuando pasas el ratón */
.darkmode-toggle:hover::after {
    opacity: 1;
}

/* ===============================
   🌓 ICONO EN MODO OSCURO
   =============================== */
.darkmode--activated .darkmode-toggle {
    background: #222 !important;
    color: #fff !important;
}


/* ===============================
   💬 TOOLTIP: “Modo Oscuro”
   =============================== */

.darkmode-toggle::after {
    content: "Modo Oscuro";
    position: absolute;
    bottom: 120%;
    right: -15px;
    font-size: 12px;
    padding: 6px 10px;
    background: #0f4c81;
    color: #fff;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
}

/* ✅ SOLO MÓVIL: mostrar tooltip durante 1s tras el click */
.darkmode-toggle.show-mobile-tooltip::after {
    opacity: 1;
}

/* ✅ SOLO ESCRITORIO: tooltip al pasar el ratón */
@media (min-width: 769px) {
    .darkmode-toggle:hover::after {
        opacity: 1;
    }
}



/* =========================================
   ESLOGAN EN CABECERA – COLOR SEGÚN DISPOSITIVO
   ========================================= */

.site-description {
    color: #000000;  /* Negro */
    font-size: 16px;
    margin: 0;
    font-weight: 500;
    line-height: 1.3;
    text-align: center;
}

/* ===========
   Eslogan en MÓVIL (fondo azul)
   =========== */
@media (max-width: 768px) {
    .site-description {
        color: #ffffff;  /* Blanco */
        font-size: 14px;
        text-align: center;
    }
}


/* Tamaño del título del sitio (versión PC) */
.site-title {
    text-align: center;
    width: 100%;
}

.site-title a {
    font-size: 40px;   /* Ajusta aquí el tamaño */
    font-weight: 600;  /* Opcional: un poco más de grosor */
    display: block;
}

/* Eslogan centrado debajo del título */
.site-description {
    text-align: center;
}

/* Tamaño del título en móviles */
@media (max-width: 768px) {
    .site-title a {
        font-size: 22px;  /* Más pequeño en móvil */
    }
}


/* Esto hace que las tablas no se corran las letras */
.wp-block-table .has-fixed-layout td, .wp-block-table .has-fixed-layout th, .entry-content{
  word-break: inherit;
}

.wp-block-table .has-fixed-layout {
  table-layout: auto;
  
}

.ast-menu-toggle {
  border-style: inherit;
}

.ast-icon.icon-arrow {
  font-size: 20px;
  
}


/* Ocultar flechas solo en los elementos sin submenú */
.main-navigation .menu-item:not(.menu-item-has-children) .ast-arrow-svg {
    display: none !important;
}

/* cards NIE */

.nie-guides-grid {
  display: grid;
  gap: 1.5rem;
}

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

.nie-card {
  border: 1px solid #e0e4ec;
  border-radius: 10px;
  padding: 1.25rem;
  background: #ffffff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.04);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.nie-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #002fff 0%, #0026ff 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 0;
}

.nie-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(14, 30, 252, 0.25);
  border-color: #002fff;
}

.nie-card:hover::before {
  opacity: 0.08;
}

.nie-card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
  transition: color 0.3s ease;
}

.nie-card:hover h3 {
  color: #002fff;
}

.nie-card p {
  margin-bottom: 0.75rem;
  position: relative;
  z-index: 1;
}

.nie-card-link {
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid #0026ff;
  position: relative;
  z-index: 1;
  transition: all 0.3s ease;
}

.nie-card:hover .nie-card-link {
  color: #002fff;
  border-bottom-color: #002fff;
}


/* Estilo base para el logo */
.custom-logo {
  max-width: 100%;
  height: auto;
}

/* En pantallas pequeñas, mejora el contraste */
@media (max-width: 768px) {
  .custom-logo {
    filter: drop-shadow(0 0 3px white);
  }
}