/**
 * Accordion
 *
 * Shared styles for page-accordion template and page builder module.
 *
 * @package mohawk-consumer-2027
 */

/* ---------------------------------------------------------------
   Container
--------------------------------------------------------------- */

.accordion {
	max-width: var(--container-content, 1200px);
	margin: 0 auto;
}

/* ---------------------------------------------------------------
   Module intro
--------------------------------------------------------------- */

.accordion-module {
	.text-center,
	.text-left {
		margin-bottom: 40px;
	}

	.text-center {
		max-width: 800px;
		margin-inline: auto;
	}

	.column & .text-center {
		max-width: none;
	}
}

/* ---------------------------------------------------------------
   Accordion item
--------------------------------------------------------------- */

.accordion__item {
	&.is-open .accordion__header {
		margin-bottom: 0;

		&::after {
			background-image: url('../../../images/double-arrow-dn.png');
		}
	}

	&.is-open .accordion__body {
		max-height: 5000px;
		transition: max-height 0.5s ease-in;
	}
}

/* ---------------------------------------------------------------
   Header (h3)
--------------------------------------------------------------- */

.accordion__header {
	display: block;
	width: 100%;
	color: #fff;
	font-family: var(--font-body);
	font-size: 18px;
	font-weight: 400;
	line-height: 1.4rem !important;
	padding: 12px 40px 12px 15px;
	min-height: 45px;
	margin-top: 8px;
	cursor: pointer;
	border: none;
	text-align: left;
	background-color: var(--color-blue);
	background-image: linear-gradient(to bottom, var(--color-blue), var(--color-blue-dark));
	background-position: top left;
	position: relative;

	&::after {
		content: '';
		position: absolute;
		right: 12px;
		top: 50%;
		transform: translateY(-50%);
		width: 16px;
		height: 16px;
		background: url('../../../images/double-arrow-rt.png') no-repeat center center;
		background-size: contain;
	}

	&:hover {
		background-color: var(--color-blue-dark);
		background-image: linear-gradient(to bottom, var(--color-blue-dark), var(--color-blue));
		color: var(--color-gold);

		a,
		strong,
		span {
			color: var(--color-gold);
		}
	}

	a,
	strong,
	span {
		color: #fff;
		font-family: var(--font-body);
		font-size: 18px;
		font-weight: 400;
		text-decoration: none;
	}
}

/* ---------------------------------------------------------------
   Body (collapsible)
--------------------------------------------------------------- */

.accordion__body {
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.35s ease;
}

.accordion__content {
	padding: 15px;
	clear: both;
	background-color: #fff;
	overflow: hidden;
	cursor: auto;

	ul {
		margin: 0 0 10px 30px;
	}

	p {
		font-family: var(--font-body);
		line-height: 1.6;
	}

	img {
		width: auto;
		max-width: 100%;
		height: auto;
	}
}

/* ---------------------------------------------------------------
   Edit link (admin only)
--------------------------------------------------------------- */

.accordion__edit-link {
	display: inline-block;
	float: right;
	font-size: 13px;
	color: var(--color-blue);
	text-decoration: none;
	margin-bottom: 8px;

	&:hover {
		text-decoration: underline;
	}
}
