/**
 * F5.4b — Cookie/consent banner styling.
 *
 * Colors and type come from the site's own palette (style.css): #24241D is
 * the existing #footer background, #5D6149 is the site's existing button/
 * accent color (input[type=submit]{background:#5D6149}), Open Sans is the
 * body font. A bottom bar, not a wall: no backdrop, no full viewport
 * height, so it never covers the mobile <select> menu in the header.
 *
 * Contrast (WCAG 2.1 AA), computed against these exact colors:
 *   - white text on #24241D banner background: 15.61:1
 *   - white text on #5D6149 (Aceptar):          6.42:1
 *   - white text on #707070 (Rechazar):          4.95:1
 *   - white 2px button border vs #24241D:       15.61:1 (non-text/UI
 *     component boundary, needs only 3:1 per 1.4.11 — both buttons also
 *     pass on fill color alone: 2.43:1 and 3.15:1 respectively, so the
 *     border is a safety margin, not what carries compliance for Rechazar).
 */

.glosario-consent-banner {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 9999;
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
	background: #24241D;
	color: #fff;
	font-family: 'Open Sans', sans-serif;
	font-size: 14px;
	line-height: 1.5em;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.25);
}

.glosario-consent-banner[hidden] {
	display: none;
}

.glosario-consent-text {
	flex: 1 1 260px;
	margin: 0;
	min-width: 0;
}

.glosario-consent-text a {
	color: #fff;
	text-decoration: underline;
}

.glosario-consent-text a:hover {
	text-decoration: none;
}

.glosario-consent-actions {
	flex: 0 0 auto;
	display: flex;
	gap: 10px;
	margin-left: auto;
}

.glosario-consent-btn {
	box-sizing: border-box;
	min-width: 110px;
	padding: 10px 18px;
	font-family: inherit;
	font-size: 14px;
	font-weight: bold;
	line-height: 1.2em;
	border-radius: 4px;
	border: 2px solid #fff;
	cursor: pointer;
	color: #fff;
}

.glosario-consent-accept {
	background: #5D6149;
}

.glosario-consent-accept:hover {
	background: #474a37;
}

.glosario-consent-reject {
	background: #707070;
}

.glosario-consent-reject:hover {
	background: #5a5a5a;
}

.glosario-consent-btn:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 2px;
}

/* Fallback for browsers without :focus-visible support. */
.glosario-consent-btn:focus:not(:focus-visible) {
	outline: none;
}

.glosario-consent-btn:focus {
	outline: 3px solid #fff;
	outline-offset: 2px;
}

/* -----------------------------------------------------------------------
 * Cookie-policy page (content in deploy/legal/cookie-policy.html), all widths.
 * Both rules only match elements that exist on that page.
 *
 * "Cambiar preferencias de cookies": a plain <button>, which the site never
 * styles, rendered as the browser default (grey, Arial 13px, outset border).
 * Same look as the site's own buttons: #5D6149 fill with white text (6.42:1)
 * as input[type=submit] in style.css, the darker #474a37 hover of the banner's
 * Aceptar button, Open Sans, 4px radius; 44px tall for a comfortable tap.
 * ---------------------------------------------------------------------- */
.glosario-cookie-reopen {
	box-sizing: border-box;
	min-height: 44px;
	padding: 10px 18px;
	font-family: 'Open Sans', sans-serif;
	font-size: 1em;
	font-weight: bold;
	line-height: 1.2em;
	color: #fff;
	background: #5D6149;
	border: 0;
	border-radius: 4px;
	cursor: pointer;
}

.glosario-cookie-reopen:hover {
	background: #474a37;
}

.glosario-cookie-reopen:focus-visible {
	outline: 3px solid #5D6149;
	outline-offset: 2px;
}

/* style.css gives every <code> `display:block` (meant for code samples), which
 * split "Solo se guarda la cookie propia <code>glosario_consent</code> con tu
 * elección" into three blocks. Inside a paragraph it is a phrase: keep the
 * site's light border but flow with the sentence. */
:is(#content, #content-full) p > code {
	display: inline;
	margin: 0;
	padding: 0 0.25em;
	text-align: left;
}

@media screen and (max-width: 480px) {
	.glosario-consent-banner {
		flex-direction: column;
		align-items: stretch;
	}

	/* Compact phone layout: text, then the two buttons. The base rule's
	 * `flex: 1 1 260px` is a width basis in the desktop row, but in this column
	 * it became a 260px HEIGHT, leaving an empty gap under the text (a ~340px
	 * banner, ~40% of a 390x844 screen). Size the text to its content instead. */
	.glosario-consent-banner {
		gap: 10px;
		padding-top: 12px;
		padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
	}

	.glosario-consent-text {
		flex: 0 0 auto;
	}

	.glosario-consent-actions {
		margin-left: 0;
		width: 100%;
	}

	.glosario-consent-btn {
		flex: 1 1 0;
		min-width: 0;
		min-height: 44px;
	}
}
