/**
 * Estilos del formulario de boletín (Gravity Forms, form id 1) — footer.
 * Alcance: .gf-newsletter-embargo (cssClass del formulario) para no
 * afectar a otros formularios de Gravity Forms del sitio.
 */

/* Red de seguridad: si alguien vuelve a guardar la página del footer desde
   el editor de Divi, el shortcode puede revertir a title="true" y sacar
   este título por defecto de Gravity Forms. Lo ocultamos también por CSS
   para que nunca se muestre, pase lo que pase con el shortcode. */
#gform_wrapper_1 .gform_title {
	display: none !important;
}

/**
 * Estructura real que genera Gravity Forms:
 *   <form class="gf-newsletter-embargo">
 *     <div class="gform-body">
 *       <div class="gform_fields">
 *         <div class="gfield gfield--type-email">...</div>
 *         <div class="gfield gfield--type-checkbox">...</div>  (aviso de privacidad)
 *       </div>
 *     </div>
 *     <div class="gform_footer">...botón Subscribe...</div>
 *   </form>
 *
 * Queremos: [email][Subscribe] siempre en la misma fila, y debajo el
 * checkbox de privacidad a ancho completo. Como el checkbox vive dentro
 * de .gform_fields (junto al email) y el botón vive fuera, en
 * .gform_footer, usamos display:contents en los contenedores intermedios
 * para "aplanarlos" y poder colocar campo, botón y checkbox con CSS Grid
 * en áreas fijas (a diferencia de flex-wrap, un grid con áreas nombradas
 * no reordena el botón a una fila nueva aunque el hueco disponible sea
 * estrecho — sólo se encoge el campo de email).
 */
/**
 * IMPORTANTE — cascada de Gravity Forms: sus 4 hojas de estilo (reset,
 * foundation, framework, orbital) a veces se cargan DESPUÉS de esta hoja
 * en el <head> (ocurre cuando el shortcode sólo vive en la plantilla de
 * footer, como aquí — GF no lo detecta a tiempo para encolar su CSS en
 * el sitio habitual del <head>, así que aterriza más tarde). Cuando eso
 * pasa, sus reglas ganan cualquier propiedad que no lleve !important
 * (p. ej. su .gform_fields{display:grid} de foundation.css pisaría
 * nuestro display:contents). Por eso aquí TODA propiedad de estructura
 * (display, grid-area, grid-template-*, min-width...) lleva !important,
 * no sólo las visuales — a diferencia del resto de reglas de este
 * archivo, donde basta con marcar las visuales.
 */
.gf-newsletter-embargo {
	max-width: 540px;
	width: 100%;
	box-sizing: border-box;
	display: grid !important;
	grid-template-columns: minmax( 0, 1fr ) auto !important;
	grid-template-areas: "field button" "consent consent" !important;
	column-gap: 8px !important;
	row-gap: 20px !important;
	align-items: stretch !important;
}

.gf-newsletter-embargo .gform-body,
.gf-newsletter-embargo .gform_fields {
	display: contents !important;
}

.gf-newsletter-embargo .gfield {
	margin: 0 !important;
}

/* Fila 1: campo de email (píldora blanca) + botón (píldora oscura) */
.gf-newsletter-embargo .gfield--type-email {
	grid-area: field !important;
	min-width: 0 !important; /* permite que el input se encoja en vez de desbordar */
	height: 50px;
	background-color: #ffffff !important;
	border-radius: 30px !important;
	overflow: hidden;
}

.gf-newsletter-embargo .gform_footer {
	grid-area: button !important;
	display: flex !important;
	align-items: center !important;
	margin: 0 !important;
	padding: 0 !important;
	height: 50px;
}

/* Sólo en pantallas realmente pequeñas dejamos que el botón baje debajo
   del campo (a propósito, no como efecto colateral de un flex-wrap). */
@media ( max-width: 420px ) {
	.gf-newsletter-embargo {
		grid-template-columns: 1fr !important;
		grid-template-areas: "field" "button" "consent" !important;
	}
}

.gf-newsletter-embargo .ginput_container {
	margin-top: 0 !important;
	height: 100%;
}

.gf-newsletter-embargo input[type="email"] {
	width: 100%;
	height: 100%;
	background-color: transparent !important;
	border: none !important;
	border-radius: 0 !important;
	padding: 18px 22px !important;
	font-size: 15px !important;
	color: #424242 !important;
	box-shadow: none !important;
	box-sizing: border-box;
}

.gf-newsletter-embargo input[type="email"]::placeholder {
	color: #888078 !important;
	opacity: 1 !important;
}

/* Quita el borde/anillo verde que Gravity Forms pinta al enfocar el campo. */
.gf-newsletter-embargo input[type="email"]:focus {
	outline: none !important;
	box-shadow: none !important;
	border: none !important;
}

.gf-newsletter-embargo .gform_button {
	background-color: #424242 !important;
	color: #ffffff !important;
	border: none !important;
	border-radius: 40px !important;
	padding: 15px 30px !important;
	height: 100%;
	font-size: 15px !important;
	font-weight: 600 !important;
	white-space: nowrap;
	cursor: pointer;
	transition: opacity 0.2s ease;
}

.gf-newsletter-embargo .gform_button:hover {
	opacity: 0.85 !important;
}

/* Fila 2: aviso de privacidad, a ancho completo debajo de la píldora.
   Este campo se renderiza como <fieldset>, que en varios navegadores no
   se encoge como un <div> normal: si el texto largo del aviso no puede
   envolver línea, obliga a que TODA la rejilla se ensanche más de lo que
   cabe en la columna del footer, y eso es lo que empuja al botón a otra
   fila. Se resetea el fieldset y se fuerza el ajuste de línea del texto
   para que nunca imponga un ancho mínimo mayor que el contenedor. */
.gf-newsletter-embargo .gfield--type-checkbox {
	grid-area: consent !important;
	min-width: 0 !important;
	max-width: 100%;
	border: 0;
	padding: 0;
	margin: 20px 0 0 0 !important;
}

.gf-newsletter-embargo .gfield--type-checkbox .gfield_label {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect( 0, 0, 0, 0 ) !important;
	white-space: nowrap !important;
	border-radius: 20px !important;
	border: 20px !important;
}

.gf-newsletter-embargo .gchoice {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	min-width: 0;
}

.gf-newsletter-embargo .gfield-choice-input {
	margin-top: 3px;
	accent-color: #424242 !important;
	border-color: #424242 !important;
	cursor: pointer;
	flex-shrink: 0;
	border-radius: 4px;
}

/* Mismo problema que en los campos de texto: el tema Orbital de Gravity
   Forms pinta el checkbox con el verde por defecto al enfocarlo. */
.gf-newsletter-embargo .gfield-choice-input:focus {
	outline: none !important;
	box-shadow: none !important;
	border-color: #424242 !important;
}

.gf-newsletter-embargo .gchoice label {
	font-size: 12px;
	line-height: 1.4;
	color: #424242;
	min-width: 0;
	overflow-wrap: anywhere;
}

.gf-newsletter-embargo .gchoice label a {
	color: #424242;
	text-decoration: underline;
}

.gf-newsletter-embargo .gform_confirmation_message,
.gf-newsletter-embargo .validation_error {
	color: #424242;
}