/*
 Theme Name:   GeneratePress Child
 Theme URI:    https://generatepress.com
 Description:  Default GeneratePress child theme
 Author:       Tom Usborne
 Author URI:   https://tomusborne.com
 Template:     generatepress
 Version:      0.1
*/

/* Cabecera */
/* Fijar header con sticky */
.site-header {
  position: sticky;
  z-index: 99998;
  width: 100%;
  transition: all 0.3s ease;
}

/* Visitantes normales (sin barra de admin) */
body:not(.admin-bar) .site-header {
  top: 0;
}

/* Menú principal fijo */
.site-header .main-navigation .main-nav ul ul {
    background-color: #ffffff;
    width: 240px;
    padding: 10px 0;
    border-radius: 0 0 5px 5px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-bottom: 3px solid #754aac;
}

/* Espaciado y líneas divisorias con margen lateral */
.site-header .main-navigation .main-nav ul ul li {
    padding: 5px 15px; /* Espaciado dentro de cada ítem */
    position: relative;
}

/* Línea divisoria con espacio en los lados y color #F0F0F0 */
.site-header .main-navigation .main-nav ul ul li::after {
    content: "";
    display: block;
    height: 1px;
    width: 90%; /* Ajusta el ancho de la línea */
    background-color: #F0F0F0; /* Color gris claro */
    position: absolute;
    bottom: 0;
    left: 5%;
}

/* Evitar línea en el último elemento */
.site-header .main-navigation .main-nav ul ul li:last-child::after {
    content: none;
}

/* Enlaces del submenú: Ajuste para que ocupen todo el espacio */
.site-header .main-navigation .main-nav ul ul li a {
    display: flex; 
    align-items: center;
    width: 100%; 
    padding: 15px; 
    color: #333333;
    text-decoration: none;
}

/* Hover en enlaces del submenú: ahora cubre bien todo el elemento */
.site-header .main-navigation .main-nav ul ul li:hover > a {
    background-color: #f6f6f6;
    color: #333333;
}


/* Mantiene el mismo tamaño en la cabecera sticky */
.sticky-navigation-logo {
    max-width: 200px !important;
}

/* Páginas */

/* Bordes */
.img-border-radius img{
	border-radius:0.225rem;
	
}

/* Sidebar */

/* Contenedor principal del sidebar */
.blog-topics {
  background-color: #f6f6f6;
  padding: 0;
  margin: 0;
  list-style: none;
  border-radius: 0.130rem;
}


/* Ítems de la lista */
.blog-topics li {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Estilo de los enlaces */
.blog-topics a {
  display: block;
  font-size: 0.9rem;          
  font-weight: 600;
  text-decoration: none;      
  padding: 0.6rem 0.8rem;     
  background-color: #f6f6f6;  
  border-bottom: 1px solid #ddd; 
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Eliminar separador en el último botón */
.blog-topics li:last-child a {
  border-bottom: none;
}

/* Efecto hover */
.blog-topics a:hover {
  background-color: #e9e9e9; 
}


/* Blog & entradas */

/* Margen inferior en las tablas */
.wp-block-table.is-style-stripes {
    margin-bottom: 1.5em;
}

/* Margen imágenes de las entradas */
.wp-block-image.size-full {
    margin-top: 40px;
    margin-bottom: 40px;
}

/* Entradas del blog */

.card-title {
  height: 10rem; 
  display: flex;
  align-items: flex-start;
}

.spacer {
  flex-grow: 1;
  min-height: 50px; 

}

.card-footer {
  margin-top: auto;
}

/* Márgenes SOLO para los encabezados dentro de entradas del blog */
.single-post h1,
.single-post h2,
.single-post h3,
.single-post h4,
.single-post h5,
.single-post h6 {
  margin-top: 0;
  margin-bottom: 0;
}

.single-post h2 {
  margin-top: 2.5rem;
  margin-bottom: 1.5rem;
}
.single-post h3 {
  margin-top: 2rem;
  margin-bottom: 1rem;
}
.single-post h4 {
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}
.single-post h5 {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}
.single-post h6 {
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
}

/* Listas */

/* Ajustar listas en entradas del blog */
.single-post .wp-block-list {
  padding-left: 0;
  margin-left: 0;
}

/* Listas con check morado solo en entradas del blog */
.single-post .wp-block-list li {
  position: relative;
  margin-bottom: 0.875rem !important;
  line-height: 1.5 !important;
  list-style: none;
  padding-left: 1.75rem;
}

.single-post .wp-block-list li::before {
  content: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236c5ce7' viewBox='0 0 16 16'><path d='M13.485 1.929a.75.75 0 0 1 0 1.06L6.061 10.414l-3.536-3.536a.75.75 0 0 1 1.06-1.06L6.061 8.293l6.364-6.364a.75.75 0 0 1 1.06 0z'/></svg>");
  position: absolute;
  left: 0;
  top: 0.2rem; /* ajuste vertical */
}


/* Miscelaneas */

/* Aplica a los enlaces dentro del contenido principal */
main a,
.entry-content a,
article a,
.page a {
  font-weight: 600;
}

/* Excluye menús y footer explícitamente */
nav a,
footer a {
  font-weight: inherit !important;
}


/* Subrayado títulos */
.section-title {
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: "";
  display: block;
  width: 40px; /* Largo de la línea */
  height: 5px; 
  background-color: #754aac;
  margin-top: 0.5rem;
}

/* Scroll smooth */
html {
    scroll-behavior: smooth;
}

/* Resultados de la búsqueda */
.vm-result-count {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: .5rem;
}


/* Text underline hero */
.underline-description {
  position: relative;
  display: inline-block;
  padding-bottom: 10px; /* separa más el texto de la línea */
}

.underline-description::before,
.underline-description::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
}

.underline-description::before {
  background-color: rgba(207, 207, 207, 0.30); /* línea base más clara */
}

.underline-description::after {
  background-color: #ffffff; /* línea animada */
  width: 0%;
  transition: width 0.4s ease;
  z-index: 1;
}

.underline-description:hover::after {
  width: 100%;
}

/* Buscador */
/* ============================
   CORRECCIÓN DE DESBORDAMIENTO EN RESULTADOS DE BÚSQUEDA MÓVIL
   Contexto: En la página de resultados de búsqueda, el título <h2> con un icono SVG
   causaba scroll lateral en móviles al desbordarse fuera del contenedor.
   Solución: Se aplica flexbox controlado al h2 y se limita el SVG.
   Fecha: Mayo 2025
   ============================ */

/* Convierte el h2 en un contenedor flex horizontal */
body.search h2 {
  display: flex;                  /* Alinea texto + SVG en una misma línea */
  align-items: center;           /* Centra verticalmente ambos elementos */
  justify-content: space-between; /* Deja el texto a la izquierda, SVG a la derecha */
  flex-wrap: nowrap;            /* Impide que el SVG salte a la línea siguiente */
  overflow-wrap: anywhere;      /* Permite que palabras largas se dividan si es necesario */
}

/* Limita el tamaño del SVG para evitar que sobresalga en pantallas pequeñas */
body.search h2 svg {
  max-width: 1.25em;           
  height: auto;                
  flex-shrink: 0;               
}

/* Search modal */
.search-modal-form {
	border-radius: 0.3rem;
}

/* Formulario GF */
/* Estructura general */
body .gform_wrapper {
  max-width: 100%;
  background: #f9f9f9;
  padding: 2rem;
  border-radius: 0.225rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  font-family: 'Inter', sans-serif;
  font-size: 16px;
}

/* Dos columnas responsivas */
body .gform_wrapper .gform_body ul.gform_fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 30px;
}

/* Campos que deben ocupar toda la fila */
body .gform_wrapper .gform_body ul.gform_fields li.gfield.gfield--width-full {
  grid-column: 1 / -1;
}

/* Inputs, selects y textarea */
body .gform_wrapper input[type="text"],
body .gform_wrapper input[type="email"],
body .gform_wrapper input[type="tel"],
body .gform_wrapper select,
body .gform_wrapper textarea {
  width: 100%;
  border: 1px solid #ccc;
  padding: 20px 16px;
  border-radius: 0.225rem;
  font-size: 14px;
  background-color: #fff;
}

/* Select limpio, sin doble flecha */
body .gform_wrapper select {
  padding: 0 16px;
  height: 2.625rem;
  -webkit-appearance: none;
  -moz-appearance: none;
}

body .gform_wrapper select::-ms-expand {
  display: none;
}

/* Etiquetas */
body .gform_wrapper .gfield_label {
  font-weight: 600;
  margin-bottom: 6px;
  display: block;
}

/* Checkbox RGPD */
body .gform_wrapper .gfield_checkbox label {
  font-size: 14px;
  line-height: 1.6;
}

/* Botón */
body .gform_wrapper .gform_footer input[type="submit"] {
  background-color: #754aac !important;
  min-width: 200px !important;
  font-weight: 600 !important;
  font-size: 1rem !important;
  padding: 1rem .25rem !important;
  border: none !important;
  border-radius: 0.225rem !important;
  cursor: pointer !important;
}

body .gform_wrapper .gform_footer input[type="submit"]:hover {
  background-color: #9170c2 !important;
}

/* Ocultar errores generales de Gravity Forms */
body .gform_wrapper .gform_validation_errors,
body .gform_wrapper .validation_error {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

/* Ocultar títulos y leyendas innecesarias */
.gform_title,
.gform_description,
.gform_required_legend {
  display: none;
}


/* Responsive móvil (hasta 768px) */
@media (max-width: 768px) {
  /* Gravity Forms 1 columna */
  body .gform_wrapper .gform_body ul.gform_fields {
    grid-template-columns: 1fr;
  }

  /* Ocultar elementos solo en móvil */
  .hide-on-mobile {
    display: none !important;
  }

  /* Menú lateral móvil */
  .slideout-navigation {
    width: 92% !important;
    max-width: 420px !important;
  }

  /* Ajuste del admin bar */
  #wpadminbar {
    position: fixed;
  }

  body.admin-bar .site-header {
    top: 46px;
  }
}

/* Tablet (769px a 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .slideout-navigation {
    width: 50% !important;
    max-width: none !important;
  }
}

/* Escritorio con admin bar (desde 783px) */
@media (min-width: 783px) {
  body.admin-bar .site-header {
    top: 32px;
  }
}
