/* RO Accordion Images */

.rai {
	--rai-speed: 300ms;
	--rai-line: #111;
	--rai-line-w: 1px;
	--rai-icon: 20px;

	display: flex;
	flex-direction: row;
	align-items: flex-start;
	gap: 40px;
	width: 100%;
}

/* ---------- Снимки (десктоп) ---------- */

.rai__media {
	flex: 0 0 45%;
	max-width: 45%;
	min-width: 0;
}

.rai-sticky-yes .rai__media {
	position: sticky;
	align-self: flex-start;
}

.rai__media-inner {
	display: grid;
}

.rai__img {
	grid-area: 1 / 1;
	opacity: 0;
	visibility: hidden;
	transition: opacity var(--rai-speed) ease, visibility 0s linear var(--rai-speed);
}

.rai__img.is-active {
	z-index: 1;
	opacity: 1;
	visibility: visible;
	transition-delay: 0s;
}

.rai__img img,
.rai__mobile-img img {
	display: block;
	width: 100%;
	height: auto;
	object-fit: cover;
}

/* Мобилната снимка е скрита на десктоп; показва се през inline @media от уиджета */
.rai__mobile-img {
	display: none;
}

/* ---------- Акордион ---------- */

.rai__items {
	flex: 1 1 0;
	min-width: 0;
	border-top: var(--rai-line-w) solid var(--rai-line);
}

.rai__item {
	border-bottom: var(--rai-line-w) solid var(--rai-line);
}

.rai__title {
	margin: 0;
	padding: 0;
}

/* Нулиране на стиловете на темата за бутони */
.rai .rai__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	margin: 0;
	padding: 18px 24px;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	color: inherit;
	font: inherit;
	font-weight: 600;
	letter-spacing: inherit;
	text-align: left;
	text-transform: none;
	text-decoration: none;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.rai .rai__head:hover,
.rai .rai__head:focus,
.rai .rai__head:active {
	background: none;
	box-shadow: none;
	text-decoration: none;
}

.rai .rai__head:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: -2px;
}

/* ---------- Иконка + / − ---------- */

.rai__icon {
	position: relative;
	flex: 0 0 auto;
	width: var(--rai-icon);
	height: var(--rai-icon);
	margin-left: 16px;
	color: currentColor;
}

.rai__icon::before,
.rai__icon::after {
	content: "";
	position: absolute;
	left: 0;
	top: 50%;
	width: 100%;
	height: max(2px, calc(var(--rai-icon) / 8));
	border-radius: 1px;
	background: currentColor;
	transform: translateY(-50%);
	transition: transform var(--rai-speed) ease;
}

.rai__icon::after {
	transform: translateY(-50%) rotate(90deg);
}

.rai__item.is-active .rai__icon::after {
	transform: translateY(-50%) rotate(0deg);
}

/* ---------- Панел (плавно отваряне без JS за височини) ---------- */

.rai__panel {
	display: grid;
	grid-template-rows: 0fr;
	visibility: hidden;
	transition: grid-template-rows var(--rai-speed) ease, visibility 0s linear var(--rai-speed);
}

.rai__item.is-active .rai__panel {
	grid-template-rows: 1fr;
	visibility: visible;
	transition-delay: 0s;
}

.rai__panel-inner {
	min-height: 0;
	overflow: hidden;
}

.rai__body {
	padding: 4px 24px 24px;
}

.rai__content > :first-child {
	margin-top: 0;
}

.rai__content > :last-child {
	margin-bottom: 0;
}

@media (prefers-reduced-motion: reduce) {
	.rai *,
	.rai *::before,
	.rai *::after {
		transition-duration: 0s !important;
		transition-delay: 0s !important;
	}
}
