.cv-drawer {
	display: flex;
}

/* Inherit the surrounding text color: on-header in the Cartavera header, the content color elsewhere. */
.cv-drawer__toggle {
	color: inherit;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 40px;
	padding: 6px 10px;
	border: 1px solid transparent;
	border-radius: var(--wp--preset--border-radius--sm);
	background: transparent;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}

.cv-drawer__toggle:hover {
	border-color: currentcolor;
}

.cv-drawer__toggle:focus-visible {
	outline: 2px solid var(--cv-accent-focus, var(--wp--preset--color--accent));
	outline-offset: 1px;
}

.cv-drawer.is-icon-only .cv-drawer__toggle {
	padding: 8px;
	min-width: 44px;
	min-height: 44px;
	justify-content: center;
}

.cv-drawer__panel {
	position: fixed;
	inset-block: 0;
	inset-inline: 0 auto;
	width: min(365px, 88vw);
	max-width: none;
	height: 100%;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	box-shadow: var(--wp--preset--shadow--lg);
	transform: translateX(-100%);
	transition: transform 200ms ease;
	overflow: hidden;
}

.rtl .cv-drawer__panel {
	transform: translateX(100%);
}

.cv-drawer__panel.is-open {
	transform: translateX(0);
}

.cv-drawer__panel::backdrop {
	background: rgba(8, 12, 18, 0);
	transition: background 200ms ease;
}

.cv-drawer__panel.is-open::backdrop {
	background: rgba(8, 12, 18, 0.62);
}

.cv-drawer__inner {
	display: flex;
	flex-direction: column;
	height: 100%;
}

.cv-drawer__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding-block: 12px;
	padding-inline: 20px 12px;
	background: var(--wp--preset--color--header-alt);
	color: var(--wp--preset--color--on-header);
}

.cv-drawer__panel .cv-drawer__greeting {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--wp--preset--color--on-header);
	font-size: var(--wp--preset--font-size--large);
	font-weight: 750;
	text-decoration: none;
}

.cv-drawer__greeting:hover {
	color: inherit;
	text-decoration: underline;
}

.cv-drawer__close {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: inherit;
	cursor: pointer;
}

.cv-drawer__close:hover,
.cv-drawer__close:focus-visible {
	background: color-mix(in srgb, currentcolor 12%, transparent);
}

.cv-drawer__close:focus-visible {
	outline: 2px solid var(--cv-accent-focus, var(--wp--preset--color--accent));
}

.cv-drawer__body {
	flex: 1;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding-bottom: 24px;
}

.cv-drawer__heading {
	margin: 0;
	padding: 18px 20px 8px;
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 750;
	letter-spacing: 0;
	border-top: 1px solid var(--wp--preset--color--line);
}

.cv-drawer__heading:first-child {
	border-top: 0;
}

.cv-drawer__list,
.cv-drawer__sublist {
	list-style: none;
	margin: 0;
	padding: 0 0 8px;
}

.cv-drawer__panel .cv-drawer__list a,
.cv-drawer__group summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 44px;
	padding: 8px 20px;
	color: var(--wp--preset--color--contrast);
	font-size: var(--wp--preset--font-size--base);
	text-decoration: none;
	cursor: pointer;
}

.cv-drawer__group summary {
	list-style: none;
}

.cv-drawer__group summary::-webkit-details-marker {
	display: none;
}

.cv-drawer__group summary .cv-icon {
	color: var(--wp--preset--color--muted);
	transition: transform var(--wp--custom--transition);
}

.cv-drawer__group[open] summary {
	font-weight: 700;
}

/* The chevron points to the inline end when closed and down when open. */
.rtl .cv-drawer__group summary .cv-icon {
	transform: scaleX(-1);
}

.cv-drawer__group[open] summary .cv-icon {
	transform: rotate(90deg);
}

.cv-drawer__sublist {
	background: var(--wp--preset--color--subtle);
}

.cv-drawer__panel .cv-drawer__sublist a {
	padding-inline-start: 34px;
	font-size: var(--wp--preset--font-size--small);
}

.cv-drawer__list a:focus-visible,
.cv-drawer__group summary:focus-visible {
	outline: 2px solid var(--wp--preset--color--hyperlink);
	outline-offset: -2px;
}

.cv-drawer__panel .cv-drawer__list a:hover,
.cv-drawer__group summary:hover {
	background: var(--wp--preset--color--subtle);
	color: var(--wp--preset--color--contrast);
	text-decoration: none;
}

@media (prefers-reduced-motion: reduce) {

	.cv-drawer__panel,
	.cv-drawer__panel::backdrop {
		transition: none;
	}
}
