/* seo-geo.es · Puente entre Divi 5 y el diseño del prototipo
   ---------------------------------------------------------------------------------------------------------------
   Cada página está construida con secciones, filas, columnas y módulos de Divi que llevan las clases sg- del
   prototipo (Avanzado → ID y clases CSS). Para que el resultado sea idéntico al prototipo:

   1. styles.css y gravity.css se publican con el prefijo body.sg-divi en cada regla (lo hace el generador), así
      ganan a los estilos por defecto de Divi aunque Divi cargue su CSS después.
   2. Este archivo neutraliza lo que Divi añade por defecto. Las reglas «suaves» usan :where() para que las clases
      del prototipo sigan mandando sobre ellas.
   3. Los envoltorios de Divi sin clase sg- se vuelven «transparentes» (display: contents): textos, botones e imágenes
      quedan como hijos directos de su fila, columna o grupo, igual que en el HTML del prototipo, y las rejillas y
      flex del diseño funcionan tal cual. En el Visual Builder (body.et-fb) se mantienen para poder seleccionar módulos.

   Se carga entre styles.css y gravity.css. */

/* ---------- 1. Base (suave: especificidad 0,1,1) ---------- */
body.sg-divi { font-family: var(--f-text); font-size: var(--fs-base); line-height: 1.6; color: var(--ink); font-weight: 400; background: var(--paper); }
body.sg-divi #page-container { padding-top: 0 !important; overflow: visible; background: transparent; }
body.sg-divi #et-main-area, body.sg-divi #main-content { background: transparent; }
body.sg-divi #main-header, body.sg-divi #main-footer, body.sg-divi #top-header { display: none; }
body.sg-divi :where(.et-l) :where(p, li, h1, h2, h3, h4, h5, h6) { padding-bottom: 0; }
body.sg-divi :where(.et-l) :where(h1, h2, h3, h4, h5, h6) { color: inherit; line-height: 1.12; }
body.sg-divi :where(.et-l) :where(a) { color: inherit; }
body.sg-divi :where(.et-l) :where(a:not([class])) { text-decoration: underline; text-decoration-color: var(--orange); text-decoration-thickness: 2px; text-underline-offset: .22em; }
body.sg-divi :where(.et-l) :where(ul, ol) { list-style: none; padding: 0; line-height: inherit; }
body.sg-divi :where(.et-l) :where(ul:not([class])) { list-style: disc; padding-left: 1.2em; }
body.sg-divi :where(.et-l) :where(ol:not([class])) { list-style: decimal; padding-left: 1.2em; list-style-position: outside; }
body.sg-divi :where(.et-l) :where(dl) { margin: 0; }
body.sg-divi :where(.et-l) :where(dd) { margin-left: 0; }
body.sg-divi :where(.et-l) :where(blockquote) { border: 0; padding: 0; margin: 0; }
body.sg-divi :where(.et-l) :where(.et_pb_group) { display: block; --flex-direction: row; flex-direction: row; column-gap: normal; row-gap: normal; }
body.sg-divi :where(.et-l) :where(.et_pb_section) { padding: 0; }
body.sg-divi :where(.et-l) :where(.et_pb_row) { width: 100%; max-width: var(--container); margin-inline: auto; padding: 0 clamp(1.1rem, .6rem + 2.4vw, 2.5rem); }
body.sg-divi :where(.et-l) :where(.et_flex_module) { display: block; --flex-direction: row; flex-direction: row; }
body.sg-divi .sg-skip { position: fixed; }

/* ---------- 2. Estructura: secciones, filas, columnas y módulos ---------- */
body.sg-divi .et-l .et_pb_section:not([class*="sg-"]) { background-color: transparent; }
body.sg-divi .et-l .et_pb_row::after { display: none; }
body.sg-divi .et-l .et_pb_row { width: 100% !important; max-width: var(--container) !important; margin-left: auto !important; margin-right: auto !important; }
body.sg-divi .et-l .et_pb_column { float: none; width: auto !important; margin: 0 !important; min-height: 0; }
body.sg-divi .et-l .et_pb_row.sg-split, body.sg-divi .et-l .et_pb_row.sg-grid, body.sg-divi .et-l .et_pb_row.sg-phero__grid, body.sg-divi .et-l .et_pb_row.sg-hero__grid,
body.sg-divi .et-l .et_pb_row.sg-article, body.sg-divi .et-l .et_pb_row.sg-tiers, body.sg-divi .et-l .et_pb_row.sg-footer__top { display: grid; }
body.sg-divi .et-l .et_pb_module:not([class*="sg-"]) { margin-bottom: 0 !important; }
body.sg-divi :where(.et-l) :where(.et_pb_module) { margin-bottom: 0; }
/* Divi quita el margen inferior al último módulo de cada columna; estos bloques del diseño lo necesitan */
body.sg-divi .et-l .et_pb_column > .et_pb_module.head:last-child { margin-bottom: clamp(2rem, 1.4rem + 2vw, 3.4rem) !important; }
body.sg-divi .et-l .et_pb_column > .et_pb_module.sg-answer:last-child { margin-bottom: 1.8rem !important; }
body.sg-divi .et-l .et_pb_text, body.sg-divi .et-l .et_pb_code { font-size: inherit; line-height: inherit; color: inherit; }
body.sg-divi .et-l .et_pb_image { text-align: inherit; line-height: 0; }
body.sg-divi .et-l .et_pb_image img { max-width: 100%; }

/* ---------- 3. Envoltorios transparentes (fuera del Visual Builder) ---------- */
body.sg-divi:not(.et-fb) .et-l .et_pb_row:not(.sg-split):not(.sg-grid):not(.sg-phero__grid):not(.sg-hero__grid):not(.sg-article):not(.sg-tiers):not(.sg-footer__top) > .et_pb_column:not([class*="sg-"]),
body.sg-divi:not(.et-fb) .et-l .et_pb_text:not([class*="sg-"]),
body.sg-divi:not(.et-fb) .et-l .et_pb_code:not([class*="sg-"]),
body.sg-divi:not(.et-fb) .et-l .et_pb_image:not([class*="sg-"]),
body.sg-divi:not(.et-fb) .et-l .et_pb_button_module_wrapper,
body.sg-divi:not(.et-fb) .et-l .et_pb_text_inner,
body.sg-divi:not(.et-fb) .et-l .et_pb_code_inner,
body.sg-divi:not(.et-fb) .et-l .et_pb_image_wrap,
body.sg-divi:not(.et-fb) .et-l .et_pb_image > a,
body.sg-divi:not(.et-fb) .et-l .et_pb_gravity_forms,
body.sg-divi:not(.et-fb) .et-l .et_pb_gravity_form_embed { display: contents; }
/* Divi envuelve en <p> los textos que empiezan con un elemento en línea (etiquetas, enlaces…): ese <p> no existe en el diseño */
body.sg-divi:not(.et-fb) .et-l .et_pb_text.sginline > .et_pb_text_inner > p { display: contents; }
body.et-fb .et-l .et_pb_module + .et_pb_module { margin-top: .75rem; }

/* ---------- Botones: módulo Botón de Divi con las clases sg-btn ---------- */
body.sg-divi .et-l .et_pb_button.sg-btn {
  flex-direction: row !important; flex-wrap: nowrap; white-space: nowrap; align-items: center; justify-content: center; gap: .6em; min-height: 50px; padding: .85em 1.35em !important;
  border: 2px solid var(--bd) !important; border-radius: var(--radius-pill) !important; background: var(--bg) !important; color: var(--fg) !important;
  font: 600 1rem/1.1 var(--f-text) !important; letter-spacing: -.005em; text-decoration: none;
}
body.sg-divi .et-l .et_pb_button.sg-btn--sm { min-height: 44px; padding: .6em 1.05em !important; font-size: .94rem !important; }
body.sg-divi .et-l .et_pb_button.sg-btn--block, body.sg-divi .gform_wrapper .gform_footer .et_pb_button.sg-btn { width: 100% !important; max-width: none !important; display: flex; margin: 0 !important; }
body.sg-divi .et-l .et_pb_button.sg-btn::before { content: none !important; display: none !important; }
body.sg-divi .et-l .et_pb_button.sg-btn::after { content: none !important; display: none !important; }
body.sg-divi .et-l .et_pb_button.sg-btn--arrow::after {
  content: "" !important; display: inline-block !important; position: static !important; align-self: center; flex: none; opacity: 1 !important; margin: 0 !important; width: 16px; height: 16px; font-size: 0 !important; line-height: 0 !important;
  background-color: currentColor; transition: transform .25s var(--ease); transform: none !important; top: auto !important;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2 8h11M9 4l4 4-4 4' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2 8h11M9 4l4 4-4 4' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
body.sg-divi .et-l .et_pb_button.sg-btn--arrow:hover::after { transform: translateX(3px) !important; }

/* ---------- Conmutadores de Divi (preguntas frecuentes) con el aspecto del acordeón sg-faq ---------- */
body.sg-divi .et-l .sg-faq > .et_pb_toggle { border: 0; border-bottom: 1px solid var(--line); background: transparent !important; padding: 0; margin: 0 !important; }
body.sg-divi .et-l .sg-faq .et_pb_toggle_title {
  position: relative; display: flex; align-items: center; min-height: calc(34px + 2.4rem); box-sizing: border-box; padding: 1.2rem calc(34px + 1.5rem) 1.2rem 0; cursor: pointer;
  font: 600 clamp(1.02rem, .98rem + .25vw, 1.15rem)/1.4 var(--f-text) !important; color: var(--ink) !important; transition: color .2s; margin-bottom: 0;
}
body.sg-divi .et-l .sg-faq .et_pb_toggle_title:hover { color: var(--orange-ink) !important; }
body.sg-divi .et-l .sg-faq .et_pb_toggle_title::before {
  content: "" !important; position: absolute; right: 0; left: auto; top: 50%; width: 34px; height: 34px; margin-top: -17px; border: 1.5px solid var(--line-strong); border-radius: 50%; box-sizing: border-box;
  background: linear-gradient(var(--ink), var(--ink)) center / 12px 2px no-repeat, linear-gradient(var(--ink), var(--ink)) center / 2px 12px no-repeat;
  font-size: 0 !important; transform: none; transition: background-color .2s, border-color .2s;
}
body.sg-divi .et-l .sg-faq .et_pb_toggle_open .et_pb_toggle_title::before {
  display: block; background: var(--orange) linear-gradient(var(--ink), var(--ink)) center / 12px 2px no-repeat; border-color: var(--orange);
}
body.sg-divi .et-l .sg-faq .et_pb_toggle_content { padding: 0 3.5rem 1.4rem 0; color: var(--ink); max-width: 72ch; font-size: 1rem; line-height: 1.6; }
body.sg-divi .et-l .sg-faq .et_pb_toggle_content p { margin: 0 0 .6em; }
body.sg-divi .et-l .sg-section--dark .sg-faq > .et_pb_toggle { border-color: rgba(255,255,255,.18); }
body.sg-divi .et-l .sg-section--dark .sg-faq .et_pb_toggle_title, body.sg-divi .et-l .sg-section--dark .sg-faq .et_pb_toggle_content { color: #fff !important; }
body.sg-divi .et-l .sg-section--dark .sg-faq .et_pb_toggle_title::before { border-color: rgba(255,255,255,.3); background: linear-gradient(#fff, #fff) center / 12px 2px no-repeat, linear-gradient(#fff, #fff) center / 2px 12px no-repeat; }

/* ---------- Theme Builder: plantilla de entradas (sección a ancho completo con el contenido de la entrada) ---------- */
body.sg-divi .et-l--body .et_pb_section.sg-postwrap { display: block; padding: 0; background: transparent; }
body.sg-divi:not(.et-fb) .et-l--body .sg-postwrap > .et_pb_module, body.sg-divi:not(.et-fb) .et-l--body .sg-postwrap .et_pb_post_content { display: contents; }

/* ---------- Theme Builder: cabecera fija y pie ---------- */
body.sg-divi .et-l--header { position: sticky; top: 0; z-index: 100; }
body.sg-divi .et-l--header .et_pb_column.sg-header__inner { display: flex; flex-direction: row !important; flex-wrap: nowrap !important; align-items: center !important; justify-content: flex-start !important; gap: 1rem; min-height: var(--header-h); }
body.sg-divi .et-l--header .et_pb_image.sg-logo { flex: none; width: auto; text-align: left; margin: 0 !important; }
body.sg-divi .et-l--header .et_pb_image.sg-logo img { width: 168px; height: auto; }
body.sg-divi .et-l--footer .et_pb_section.sg-mobilebar-wrap { padding: 0; }
