/**
 * Caja de información — the cover panel's surface, on its own and placeable.
 *
 * The same three backgrounds the cover offers, built by the same PHP, and the
 * image on its own layer above a flat colour so something sensible is on screen
 * while the photograph loads and after it is deleted.
 *
 * Smaller than the cover on purpose. That panel is the first thing on the page
 * and is sized to fill a screen; this one sits in the flow beside other things
 * and has to leave room for them.
 */
.ps-info-box {
	position: relative;
	isolation: isolate;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: var(--ps-space-3);
	overflow: hidden;
	min-height: clamp(160px, 20vw, 260px);
	height: 100%;
	padding: clamp(var(--ps-space-5), 3.5vw, var(--ps-space-7));
	border: 1px solid var(--ps-info-border, var(--ps-color-border));
	border-radius: var(--ps-radius-lg);
	background: var(--ps-info-bg, var(--ps-color-surface));
	color: var(--ps-info-text, var(--ps-color-text));
}

/*
 * `height: 100%` above is what makes two of these level inside a Columns
 * block: the column is a flex item stretched to the row's height, and without
 * it the shorter box stops at its own text and the row looks broken.
 */

.ps-info-box__image {
	position: absolute;
	inset: 0;
	z-index: -2;
	background-image: var(--ps-cover-image);
	background-position: var(--ps-cover-focus, 50% 50%);
	background-size: cover;
	background-repeat: no-repeat;
}

/*
 * The scrim, and only one gradient of it.
 *
 * The cover's leans left because its text always sits there. This box can be
 * aligned three ways, so a directional scrim would be wrong two times out of
 * three; a flat dim the editor sets, with a gentle darkening towards the foot,
 * reads the same whichever side the words are on.
 */
.ps-info-box__image::after {
	position: absolute;
	inset: 0;
	background:
		linear-gradient(180deg, rgb(8 16 28 / 18%) 0%, rgb(8 16 28 / 46%) 100%),
		rgb(8 16 28 / var(--ps-cover-dim, 45%));
	content: "";
}

.ps-info-box__body {
	display: flex;
	flex-direction: column;
	gap: var(--ps-space-3);
	min-width: 0;
	/*
	 * Inherited so the button follows the box's alignment. Stretched, which is
	 * a flex column's default, it would run the full width of the panel at
	 * every alignment — and a button as wide as the box is not a button.
	 */
	align-items: inherit;
}

.ps-info-box__kicker {
	margin: 0;
	color: var(--ps-info-muted, var(--ps-color-text-muted));
	font-family: var(--ps-font-display);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .18em;
	text-transform: uppercase;
}

.ps-info-box__title {
	max-width: 22ch;
	margin: 0;
	font-family: var(--ps-font-display);
	font-size: clamp(26px, 3.1vw, 44px);
	font-weight: 700;
	line-height: 1;
	/* A single long word — a model name, a URL — breaks rather than widening
	   the box past its column. */
	overflow-wrap: anywhere;
}

.ps-info-box__text {
	max-width: 46ch;
	margin: 0;
	color: var(--ps-info-muted, var(--ps-color-text-muted));
	font-size: clamp(0.95rem, 1.2vw, 1.05rem);
	line-height: 1.6;
}

/*
 * Alignment moves three things together: where the block sits in the box, where
 * its lines break, and which edge the two `max-width`s measure from. Set on the
 * box and inherited, so a new element inside it is aligned without being told.
 */
.ps-info-box--izquierda {
	align-items: flex-start;
	text-align: left;
}

.ps-info-box--centro {
	align-items: center;
	text-align: center;
}

.ps-info-box--derecha {
	align-items: flex-end;
	text-align: right;
}

.ps-info-box--centro .ps-info-box__title,
.ps-info-box--centro .ps-info-box__text {
	margin-inline: auto;
}

.ps-info-box--derecha .ps-info-box__title,
.ps-info-box--derecha .ps-info-box__text {
	margin-inline-start: auto;
}

/*
 * The button, inverting with the surface.
 *
 * On a pale panel it is the brand colour carrying white; on a dark one or a
 * photograph those two swap, decided in PHP beside the text colours so the
 * whole box changes together rather than in two places that can disagree.
 */
.ps-info-box__action {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 46px;
	margin-top: var(--ps-space-2);
	padding: 0 var(--ps-space-5);
	border-radius: var(--ps-radius-md);
	background: var(--ps-info-button-bg, var(--ps-color-brand-600));
	color: var(--ps-info-button-text, var(--ps-color-surface));
	font-family: var(--ps-font-display);
	font-size: 14px;
	font-weight: 700;
	letter-spacing: .04em;
	text-align: center;
	text-decoration: none;
	text-transform: uppercase;
	transition: opacity var(--ps-transition-fast);
}

/*
 * Fading rather than swapping colours on hover: the two ends are set per
 * surface, so any pair of hover colours written here would be wrong for one of
 * them. Opacity is the one change that reads the same on both.
 */
@media (hover: hover) and (pointer: fine) {
	.ps-info-box__action:hover {
		opacity: .88;
	}
}

.myc-app-body .ps-info-box__action:focus-visible {
	outline: 2px solid var(--ps-info-button-bg, var(--ps-color-brand-600));
	outline-offset: 3px;
}

@media (max-width: 760px) {
	.ps-info-box {
		min-height: clamp(140px, 34vw, 220px);
	}

	.ps-info-box__title {
		font-size: clamp(24px, 7vw, 34px);
	}
}
