/* Custom Sitemap widget styles
   .asw-sitemap is the flex container; each .asw-sitemap-column holds one
   parent (h6) + its child <ul>. Column width is driven by --asw-columns
   and --asw-gap so it stays accurate regardless of the configured gap.
   Below 767px (default) the widget becomes an accordion: children are
   hidden until their caret is toggled open. */

.asw-sitemap,
.asw-sitemap * {
	box-sizing: border-box;
}

.asw-sitemap {
	--asw-columns: 4;
	--asw-gap: 32px;
	--asw-duration: 350ms;
	display: flex;
	flex-wrap: wrap;
	width: 100%;
}

.asw-sitemap ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.asw-sitemap li {
	list-style: none;
}

.asw-sitemap-column {
	flex: 0 0 calc((100% - (var(--asw-gap) * (var(--asw-columns) - 1))) / var(--asw-columns));
	max-width: calc((100% - (var(--asw-gap) * (var(--asw-columns) - 1))) / var(--asw-columns));
	min-width: 0;
}

.asw-parent-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 16px;
}

.asw-parent-title {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
}

.asw-parent-title a {
	color: #15151a;
	text-decoration: none;
}

.asw-children-list a {
	display: inline-block;
	color: rgba(21, 21, 26, 0.75);
	text-decoration: none;
	line-height: 1.5;
}

.asw-children-list li {
	margin-bottom: 10px;
}

.asw-children-list li:last-child {
	margin-bottom: 0;
}

/* Caret: hidden on desktop — children are always shown there */
.asw-caret {
	display: none;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	color: #15151a;
	cursor: pointer;
	transition: transform var(--asw-duration) ease;
}

.asw-caret svg {
	width: 16px;
	height: 16px;
	stroke: currentColor;
	pointer-events: none;
}

/* Accordion mode — applied via a class the JS toggles based on the
   widget's configured breakpoint, so the threshold stays admin-controlled
   rather than being hardcoded to one fixed CSS breakpoint. */
.asw-sitemap.asw-accordion-mode .asw-sitemap-column {
	flex: 0 0 100%;
	max-width: 100%;
}

.asw-sitemap.asw-accordion-mode .asw-parent-row {
	cursor: pointer;
}

.asw-sitemap.asw-accordion-mode .asw-caret {
	display: inline-flex;
}

.asw-sitemap.asw-accordion-mode .asw-children-list {
	max-height: 0;
	overflow: hidden;
	opacity: 0;
	transition: max-height var(--asw-duration) ease, opacity calc(var(--asw-duration) * 0.7) ease;
}

.asw-sitemap.asw-accordion-mode .asw-sitemap-column.is-open .asw-children-list {
	max-height: 1000px;
	opacity: 1;
}

.asw-sitemap.asw-accordion-mode .asw-sitemap-column.is-open .asw-caret {
	transform: rotate(180deg);
}

.asw-editor-notice {
	padding: 20px;
	border: 1px dashed rgba(0, 0, 0, 0.2);
	border-radius: 8px;
	color: rgba(0, 0, 0, 0.6);
	font-size: 14px;
}
