/*
 * LAU home - "Descargar proyecto" section support layer.
 *
 * Background, border, radius, padding, shadow and every gap come from block
 * attributes and theme.json presets; the card's hover comes from the shared
 * `lau-interactive-cards` utility. Only what Gutenberg has no control for lives
 * here: the icon glyph, the notice glyph, the lookup field styling and the
 * reveal.
 *
 * Every selector is scoped to .lau-descargar, so nothing here can reach the
 * header, the hero or the previous sections.
 */

.lau-descargar__intro > * {
	max-width: 34rem;
}

/* ---------- Card header ---------- */

.lau-descargar__icon {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 0.5rem;
	background-color: var(--wp--preset--color--spx-ink);
}

.lau-descargar__icon::before {
	content: "";
	width: 1.15rem;
	height: 1.15rem;
	background-color: var(--wp--preset--color--spx-paper);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='10' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%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 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='10' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---------- Field and button ----------
 *
 * The lookup renders through the native search block. Direct form and Fluent
 * Forms selectors stay as a compatibility layer for older generated content.
 */
.lau-descargar .fluentform,
.lau-descargar__lookup {
	margin-top: var(--wp--preset--spacing--50);
}

.lau-descargar__step p:not(.lau-descargar__num),
.lau-descargar__card > p:not(.lau-descargar__notice),
.lau-descargar__lookup label,
.lau-descargar__lookup input,
.lau-descargar__lookup button {
	font-size: 1rem !important;
}

.lau-descargar__step p:not(.lau-descargar__num),
.lau-descargar__card > p:not(.lau-descargar__notice) {
	line-height: 1.55 !important;
}

.lau-descargar__lookup button {
	line-height: 1.15 !important;
}

.lau-descargar .fluentform .ff-el-group {
	margin: 0 !important;
}

@media (min-width: 640px) {
	.lau-descargar__lookup-row,
	.lau-descargar__lookup .wp-block-search__inside-wrapper,
	.lau-descargar .fluentform fieldset {
		display: flex;
		align-items: flex-end;
		gap: 0.75rem;
	}

	.lau-descargar__lookup-row input,
	.lau-descargar__lookup .wp-block-search__input,
	.lau-descargar .fluentform .ff-el-group:not(.ff_submit_btn_wrapper) {
		flex: 1 1 auto;
		min-width: 0;
	}

	.lau-descargar__lookup-row button,
	.lau-descargar__lookup .wp-block-search__button,
	.lau-descargar .fluentform .lau-descargar__submit {
		flex: 0 0 auto;
	}

	.lau-descargar__lookup button,
	.lau-descargar__lookup .wp-block-search__button,
	.lau-descargar .fluentform button.ff-btn-submit {
		width: auto !important;
	}
}

.lau-descargar__lookup label,
.lau-descargar__lookup .wp-block-search__label,
.lau-descargar .fluentform .ff-el-input--label label {
	display: block;
	margin-bottom: 0.5rem;
	font-family: var(--wp--preset--font-family--spx-mono);
	font-size: var(--wp--preset--font-size--spx-xs);
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--spx-ink);
}

.lau-descargar__lookup input,
.lau-descargar__lookup .wp-block-search__input,
.lau-descargar .fluentform .ff-el-form-control {
	box-sizing: border-box;
	width: 100% !important;
	height: 3rem !important;
	padding: 0 1rem !important;
	border: 1px solid var(--wp--preset--color--spx-border) !important;
	border-radius: 0.5rem !important;
	background-color: var(--wp--preset--color--spx-surface) !important;
	color: var(--wp--preset--color--spx-ink) !important;
	font-family: var(--wp--preset--font-family--spx-mono) !important;
	font-size: var(--wp--preset--font-size--spx-small) !important;
	text-transform: uppercase;
}

.lau-descargar__lookup input::placeholder,
.lau-descargar__lookup .wp-block-search__input::placeholder,
.lau-descargar .fluentform .ff-el-form-control::placeholder {
	text-transform: none;
	color: var(--wp--preset--color--spx-muted-foreground);
}

.lau-descargar__lookup input:focus,
.lau-descargar__lookup .wp-block-search__input:focus,
.lau-descargar .fluentform .ff-el-form-control:focus {
	outline: none !important;
	box-shadow: none !important;
	border-color: var(--wp--preset--color--spx-primary) !important;
}

.lau-descargar .fluentform .lau-descargar__submit {
	margin: 0 !important;
}

.lau-descargar__lookup button,
.lau-descargar__lookup .wp-block-search__button,
.lau-descargar .fluentform button.ff-btn-submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	width: 100%;
	height: 3rem !important;
	padding: 0 1.5rem !important;
	border: 0 !important;
	border-radius: 0.5rem !important;
	background-color: var(--wp--preset--color--spx-primary) !important;
	box-shadow: var(--wp--preset--shadow--spx-plan);
	color: var(--wp--preset--color--spx-paper) !important;
	font-family: inherit !important;
	font-size: var(--wp--preset--font-size--spx-small) !important;
	font-weight: 600 !important;
	white-space: nowrap;
	cursor: pointer;
	transition:
		transform 0.5s cubic-bezier(0.16, 0.84, 0.28, 1),
		box-shadow 0.5s cubic-bezier(0.16, 0.84, 0.28, 1);
}

.lau-descargar__lookup button::before,
.lau-descargar__lookup .wp-block-search__button::before,
.lau-descargar .fluentform button.ff-btn-submit::before {
	content: "";
	width: 1rem;
	height: 1rem;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.3-4.3'/%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 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.3-4.3'/%3E%3C/svg%3E") center / contain no-repeat;
}

@media (hover: hover) {
	.lau-descargar__lookup button:hover,
	.lau-descargar__lookup .wp-block-search__button:hover,
	.lau-descargar .fluentform button.ff-btn-submit:hover {
		transform: translateY(-0.125rem);
		box-shadow: var(--wp--preset--shadow--spx-lift);
		background-color: var(--wp--preset--color--spx-primary) !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	.lau-descargar__lookup button:hover,
	.lau-descargar__lookup .wp-block-search__button:hover,
	.lau-descargar .fluentform button.ff-btn-submit:hover {
		transform: none;
	}
}

@media (max-width: 639.98px) {
	.lau-descargar__lookup-row {
		display: grid;
		gap: 0.75rem;
	}

	.lau-descargar__lookup .wp-block-search__inside-wrapper {
		display: grid;
		gap: 0.75rem;
	}
}

/* ---------- Footer notes ---------- */

.lau-descargar__notice {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	padding-top: var(--wp--preset--spacing--30);
	border-top: 1px solid var(--wp--preset--color--spx-border);
	font-size: 1rem !important;
	line-height: 1.55 !important;
}

.lau-descargar__lookup button {
	font-size: 1rem !important;
}

.lau-descargar__notice::before {
	content: "";
	flex: 0 0 auto;
	width: 0.85rem;
	height: 0.85rem;
	margin-top: 0.15rem;
	background-color: var(--wp--preset--color--spx-muted-foreground);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/%3E%3Cpath d='M9 12l2 2 4-4'/%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 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/%3E%3Cpath d='M9 12l2 2 4-4'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---------- Reveal ---------- */

/*
 * Scroll-driven, so it needs no JavaScript, and guarded twice: browsers without
 * `animation-timeline` never run it and show the content as it is, and a
 * reduced-motion preference opts out. The content is therefore never hidden by
 * a timeline that failed to resolve.
 */
@media (prefers-reduced-motion: no-preference) {
	@supports (animation-timeline: view()) {
		.lau-descargar__intro,
		.lau-descargar__steps,
		.lau-descargar__card {
			animation: lau-descargar-reveal linear both;
			animation-timeline: view();
			animation-range: entry 0% entry 60%;
		}

		@keyframes lau-descargar-reveal {
			from {
				opacity: 0;
				transform: translateY(1.5rem);
			}

			to {
				opacity: 1;
				transform: none;
			}
		}
	}
}
