/**
 * Public styles for Jezweb SNAP Answers
 *
 * @package Jezweb_SNAP_Answers
 * @since   1.0.0
 */

/* Wrapper */
.snap-answers-wrapper {
	margin: 20px 0;
	font-family: inherit;
}

/* Item */
.snap-answers-item {
	margin-bottom: 0;
}

.snap-answers-item:first-child .snap-answers-question {
	border-top-left-radius: 4px;
	border-top-right-radius: 4px;
}

.snap-answers-item:last-child .snap-answers-question:not(.snap-answers-active .snap-answers-question) {
	border-bottom-left-radius: 4px;
	border-bottom-right-radius: 4px;
}

.snap-answers-item:last-child .snap-answers-answer {
	border-bottom-left-radius: 4px;
	border-bottom-right-radius: 4px;
}

/* Question Button */
.snap-answers-question {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 15px 20px;
	margin: 0;
	text-align: left;
	cursor: pointer;
	border: 1px solid;
	border-bottom-width: 0;
	font-weight: 600;
	line-height: 1.4;
	transition: background-color 0.2s ease;
}

.snap-answers-item:last-child .snap-answers-question {
	border-bottom-width: 1px;
}

.snap-answers-item.snap-answers-active .snap-answers-question {
	border-bottom-width: 0;
}

.snap-answers-question:hover {
	opacity: 0.9;
}

.snap-answers-question:focus {
	outline: 2px solid #007cba;
	outline-offset: -2px;
}

.snap-answers-question:focus:not(:focus-visible) {
	outline: none;
}

.snap-answers-question:focus-visible {
	outline: 2px solid #007cba;
	outline-offset: -2px;
}

/* Question Text */
.snap-answers-question-text {
	flex: 1;
	padding-right: 15px;
}

/* Icon */
.snap-answers-icon {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.3s ease;
}

.snap-answers-icon svg {
	width: 20px;
	height: 20px;
}

.snap-answers-item.snap-answers-active .snap-answers-icon {
	transform: rotate(180deg);
}

/* Answer */
.snap-answers-answer {
	display: none;
	overflow: hidden;
	border: 1px solid;
	border-top: none;
}

.snap-answers-item:last-child .snap-answers-answer {
	border-bottom-width: 1px;
}

/* Answer Content */
.snap-answers-answer-content {
	padding: 20px;
	line-height: 1.6;
}

.snap-answers-answer-content p:first-child {
	margin-top: 0;
}

.snap-answers-answer-content p:last-child {
	margin-bottom: 0;
}

.snap-answers-answer-content ul,
.snap-answers-answer-content ol {
	margin: 15px 0;
	padding-left: 25px;
}

.snap-answers-answer-content li {
	margin-bottom: 8px;
}

.snap-answers-answer-content a {
	text-decoration: underline;
}

.snap-answers-answer-content img {
	max-width: 100%;
	height: auto;
}

/* Animation */
.snap-answers-answer.snap-answers-animating {
	display: block;
}
