/**
 * Collapsible Navigation Pattern Styles
 *
 * Provides collapsible functionality for Notion hierarchical navigation.
 *
 * @package NotionSync
 * @since 1.0.0
 */

/* Navigation container */
.notion-nav-collapsible {
	list-style: none;
	padding-left: 0;
}

.notion-nav-collapsible ul {
	list-style: none;
	padding-left: 1.5rem;
	margin-top: 0.5rem;
	margin-bottom: 0.5rem;
}

/* List items with children */
.notion-nav-collapsible li.has-children {
	position: relative;
}

/* Toggle button */
.notion-nav-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.5rem;
	height: 1.5rem;
	padding: 0;
	margin-right: 0.5rem;
	background: none;
	border: none;
	cursor: pointer;
	vertical-align: middle;
	transition: transform 0.2s ease;
}

.notion-nav-toggle:hover {
	opacity: 0.7;
}

.notion-nav-toggle:focus {
	outline: 2px solid currentColor;
	outline-offset: 2px;
	border-radius: 2px;
}

/* Chevron icon */
.notion-nav-toggle .chevron {
	display: block;
	width: 0;
	height: 0;
	border-left: 0.35rem solid transparent;
	border-right: 0.35rem solid transparent;
	border-top: 0.35rem solid currentColor;
	transition: transform 0.2s ease;
	transform: rotate(-90deg); /* Point right when collapsed */
}

/* Expanded state */
.notion-nav-toggle[aria-expanded="true"] .chevron {
	transform: rotate(0deg); /* Point down when expanded */
}

/* Collapsed child list (hidden by default) */
.notion-nav-collapsible li.has-children > ul {
	max-height: 0;
	overflow: hidden;
	opacity: 0;
	transition:
		max-height 0.3s ease,
		opacity 0.2s ease,
		margin 0.3s ease;
	margin-top: 0;
	margin-bottom: 0;
}

/* Expanded child list */
.notion-nav-collapsible li.has-children.is-expanded > ul {
	max-height: 2000px; /* Large enough for content */
	opacity: 1;
	margin-top: 0.5rem;
	margin-bottom: 0.5rem;
}

/* Links */
.notion-nav-collapsible a {
	display: inline-block;
	padding: 0.25rem 0;
	text-decoration: none;
	color: inherit;
}

.notion-nav-collapsible a:hover {
	text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 768px) {
	.notion-nav-collapsible ul {
		padding-left: 1rem;
	}
}
