/**
 * Divi Read More Block — front-end styles.
 *
 * The collapsed height is driven by --pah-rm-lines (emitted per module by
 * PHP, including tablet/phone media queries). The stylesheet alone gives a
 * working no-JS fallback; the script refines the height to the real measured
 * line-height and handles the animation.
 */

.pah-rm-wrap {
	position: relative;
}

.pah-rm-title {
	margin: 0 0 0.4em;
}

.pah-rm-content {
	overflow: hidden;
	transition: max-height var(--pah-rm-duration, 400ms) cubic-bezier(0.4, 0, 0.2, 1);
	will-change: max-height;
}

/* No-JS / pre-JS fallback: approximate N lines from the em-based line height. */
.pah-rm-content.pah-rm-collapsed {
	max-height: calc(var(--pah-rm-lines, 5) * 1.7em);
}

.pah-rm-content.pah-rm-expanded {
	max-height: none;
}

.pah-rm-content > *:first-child {
	margin-top: 0;
}

.pah-rm-content > *:last-child {
	margin-bottom: 0;
}

/* Optional soft fade on the collapsed text (off unless enabled per module). */
.pah-rm-wrap.pah-rm-has-fade .pah-rm-content.pah-rm-collapsed {
	-webkit-mask-image: linear-gradient(to bottom, #000 var(--pah-rm-fade-start, 55%), rgba(0, 0, 0, 0) 100%);
	mask-image: linear-gradient(to bottom, #000 var(--pah-rm-fade-start, 55%), rgba(0, 0, 0, 0) 100%);
}

/* ------------------------------------------------------------------------ */
/* Toggle                                                                    */
/* ------------------------------------------------------------------------ */

.pah-rm-actions {
	margin-top: 0.9em;
}

.pah-rm-actions--left {
	text-align: left;
}

.pah-rm-actions--center {
	text-align: center;
}

.pah-rm-actions--right {
	text-align: right;
}

.pah-rm-toggle {
	display: inline-block;
	cursor: pointer;
	font: inherit;
	line-height: inherit;
}

/* Text-link flavour: strip the native button chrome. */
.pah-rm-toggle--link {
	background: none;
	border: 0;
	padding: 0;
	margin: 0;
	color: inherit;
	text-decoration: underline;
	-webkit-appearance: none;
	appearance: none;
}

.pah-rm-toggle--link:hover,
.pah-rm-toggle--link:focus {
	opacity: 0.75;
}

/* Divi-button flavour inherits .et_pb_button; just neutralise <button> quirks. */
.pah-rm-toggle--button {
	-webkit-appearance: none;
	appearance: none;
}

.pah-rm-toggle:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

/* Hidden when the body is already shorter than the line limit. */
.pah-rm-wrap.pah-rm-no-toggle .pah-rm-actions {
	display: none;
}

@media (prefers-reduced-motion: reduce) {
	.pah-rm-content {
		transition: none !important;
	}
}

.pah-rm-wrap.pah-rm-no-anim .pah-rm-content {
	transition: none;
}
