/* ==========================================================================
   VWD Category Menu
   All colours and sizes are custom properties: override them in Divi
   (Theme Options → Custom CSS) e.g.  .vwdcm { --vwdcm-accent: #c0392b; }
   ========================================================================== */

.vwdcm,
.vwdcm-grid-wrap {
	--vwdcm-accent: #e2472b;
	--vwdcm-accent-text: #fff;
	--vwdcm-text: #1a1a1a;
	--vwdcm-muted: #6b6b6b;
	--vwdcm-line: #dcdcdc;
	--vwdcm-header-bg: #d4d4d4;
	--vwdcm-header-text: #111;
	--vwdcm-item-bg: #f4f4f4;
	--vwdcm-item-hover-bg: #ebebeb;
	--vwdcm-sub-bg: #f9f9f9;
	--vwdcm-bar: 7px;          /* coloured bar on main categories */
	--vwdcm-sub-bar: 3px;      /* thinner bar on subcategories */
	--vwdcm-gap: 10px;         /* space between main categories */
	--vwdcm-indent: 30px;      /* indent of each level */
	--vwdcm-pad-y: 22px;
	--vwdcm-pad-x: 38px;
	--vwdcm-font-size: 1.15em;
	--vwdcm-speed: 0.25s;
}

/* ---------- Reset (Divi styles lists and buttons inside modules) ---------- */

.vwdcm,
.vwdcm * {
	box-sizing: border-box;
}
.vwdcm ul.vwdcm-list,
.vwdcm ul.vwdcm-list li {
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
	line-height: 1.3;
}
.vwdcm ul.vwdcm-list li::before {
	content: none !important;
}
.vwdcm button {
	appearance: none;
	-webkit-appearance: none;
	background: none;
	border: 0;
	border-radius: 0;
	margin: 0;
	padding: 0;
	font: inherit;
	color: inherit;
	cursor: pointer;
	text-align: left;
}
.vwdcm a {
	text-decoration: none;
}
.vwdcm-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* ---------- Rows ---------- */

.vwdcm {
	color: var(--vwdcm-text);
	font-size: var(--vwdcm-font-size);
}
.vwdcm-row {
	display: flex;
	align-items: stretch;
	position: relative;
	transition: background-color var(--vwdcm-speed), color var(--vwdcm-speed);
}
.vwdcm-row > .vwdcm-link {
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	gap: 0.6em;
	min-width: 0;
	color: inherit;
}
.vwdcm-label {
	overflow-wrap: anywhere;
}
.vwdcm-count {
	flex: 0 0 auto;
	margin-left: auto;
	min-width: 1.9em;
	padding: 0.1em 0.55em;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.07);
	font-size: 0.7em;
	font-weight: 600;
	line-height: 1.6;
	text-align: center;
}

/* Chevron toggle */
.vwdcm-toggle {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.6em;
}
.vwdcm-toggle::after {
	content: "";
	width: 0.5em;
	height: 0.5em;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	opacity: 0.55;
	transform: translateY(-25%) rotate(45deg);
	transition: transform var(--vwdcm-speed), opacity var(--vwdcm-speed);
}
.vwdcm-toggle:hover::after,
.vwdcm-toggle:focus-visible::after {
	opacity: 1;
}
.is-open > .vwdcm-row .vwdcm-toggle::after {
	transform: translateY(25%) rotate(-135deg);
}
/* When the whole row is the toggle (link_terms="no") the chevron sits at the right */
.vwdcm-row > .vwdcm-link.vwdcm-toggle {
	width: auto;
	justify-content: flex-start;
}
.vwdcm-row > .vwdcm-link.vwdcm-toggle::after {
	margin-left: auto;
	margin-right: 0.4em;
	flex: 0 0 auto;
}

.vwdcm a:focus-visible,
.vwdcm button:focus-visible,
.vwdcm-filter-input:focus-visible {
	outline: 2px solid var(--vwdcm-accent);
	outline-offset: -2px;
}

/* ---------- Collapsible panels (animated height) ---------- */

.vwdcm-panel {
	display: grid;
	grid-template-rows: 0fr;
	visibility: hidden;
	transition: grid-template-rows var(--vwdcm-speed) ease, visibility 0s linear var(--vwdcm-speed);
}
.vwdcm-panel-inner {
	min-height: 0;
	overflow: hidden;
}
.is-open > .vwdcm-panel,
.vwdcm.is-filtering .vwdcm-panel {
	grid-template-rows: 1fr;
	visibility: visible;
	transition: grid-template-rows var(--vwdcm-speed) ease, visibility 0s;
}
.vwdcm-init .vwdcm-panel,
.vwdcm-init .vwdcm-row,
.vwdcm-init .vwdcm-toggle::after {
	transition: none !important;
}
@media (prefers-reduced-motion: reduce) {
	.vwdcm * {
		transition: none !important;
	}
}

/* ---------- Header ---------- */

.vwdcm-header {
	background: var(--vwdcm-header-bg);
	color: var(--vwdcm-header-text);
	font-weight: 700;
}
.vwdcm-header > .vwdcm-link {
	padding: var(--vwdcm-pad-y) 0 var(--vwdcm-pad-y) 1.4em;
}
.vwdcm-header .vwdcm-toggle {
	width: 3.2em;
}
.vwdcm-body > .vwdcm-panel-inner {
	padding-left: var(--vwdcm-indent);
}
.vwdcm-body > .vwdcm-panel-inner > .vwdcm-list {
	padding-top: var(--vwdcm-gap) !important;
}

/* ---------- Main categories (level 1) ---------- */

.vwdcm .vwdcm-term--main {
	margin-bottom: var(--vwdcm-gap) !important;
}
.vwdcm-term--main > .vwdcm-row {
	background: var(--vwdcm-item-bg);
	border-left: var(--vwdcm-bar) solid var(--vwdcm-accent);
}
.vwdcm-term--main > .vwdcm-row > .vwdcm-link {
	padding: var(--vwdcm-pad-y) 0.5em var(--vwdcm-pad-y) var(--vwdcm-pad-x);
}
.vwdcm-term--main > .vwdcm-row:hover {
	background: var(--vwdcm-item-hover-bg);
}

/* ---------- Subcategories (level 2+) ---------- */

.vwdcm-term--sub > .vwdcm-row {
	margin-top: 4px;
	background: var(--vwdcm-sub-bg);
	border-left: var(--vwdcm-sub-bar) solid var(--vwdcm-accent);
	font-size: 0.88em;
	font-weight: 600;
}
.vwdcm-term--sub > .vwdcm-row > .vwdcm-link {
	padding: 0.75em 0.5em 0.75em 1.1em;
}
.vwdcm-term--sub > .vwdcm-row:hover {
	background: var(--vwdcm-item-hover-bg);
}
/* Folder-style marker before subcategory names */
.vwdcm-term--sub > .vwdcm-row > .vwdcm-link::before {
	content: "";
	flex: 0 0 auto;
	width: 0.95em;
	height: 0.95em;
	background: currentColor;
	opacity: 0.45;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 6a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 6a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Nested lists: indent with a faint guide line */
.vwdcm-item > .vwdcm-panel > .vwdcm-panel-inner > .vwdcm-list {
	margin-left: calc(var(--vwdcm-indent) * 0.6) !important;
	padding: 4px 0 8px calc(var(--vwdcm-indent) * 0.4) !important;
	border-left: 1px solid var(--vwdcm-line);
}

/* ---------- Posts ---------- */

.vwdcm-post > .vwdcm-link {
	display: flex;
	align-items: baseline;
	gap: 0.55em;
	padding: 0.45em 0.5em 0.45em 0.2em;
	font-size: 0.82em;
	color: var(--vwdcm-text);
	transition: color var(--vwdcm-speed);
}
.vwdcm-post > .vwdcm-link::before {
	content: "";
	flex: 0 0 auto;
	width: 0.85em;
	height: 0.95em;
	transform: translateY(0.12em);
	background: var(--vwdcm-muted);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M3 1h9l6 6v15a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1z'/%3E%3Cpath d='M12 1v6h6M6 13h8M6 17h8'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M3 1h9l6 6v15a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1z'/%3E%3Cpath d='M12 1v6h6M6 13h8M6 17h8'/%3E%3C/svg%3E") center / contain no-repeat;
}
.vwdcm-post > .vwdcm-link:hover {
	color: var(--vwdcm-accent);
}
.vwdcm-post > .vwdcm-link:hover::before {
	background: var(--vwdcm-accent);
}

/* ---------- Current page / ancestors ---------- */

.vwdcm-term.is-current > .vwdcm-row,
.vwdcm-term.is-current > .vwdcm-row:hover {
	background: var(--vwdcm-accent);
	color: var(--vwdcm-accent-text);
}
.vwdcm-term--sub.is-current > .vwdcm-row {
	border-left-color: var(--vwdcm-accent);
}
.vwdcm-term.is-current .vwdcm-count {
	background: rgba(255, 255, 255, 0.25);
}
.vwdcm-term--main.is-ancestor > .vwdcm-row {
	background: var(--vwdcm-item-hover-bg);
}
.vwdcm-term--sub.is-ancestor > .vwdcm-row > .vwdcm-link {
	color: var(--vwdcm-accent);
}
.vwdcm-post.is-current > .vwdcm-link {
	color: var(--vwdcm-accent);
	font-weight: 700;
	box-shadow: inset 3px 0 0 var(--vwdcm-accent);
	padding-left: 0.7em;
}
.vwdcm-post.is-current > .vwdcm-link::before {
	background: var(--vwdcm-accent);
}

/* ---------- Filter box ---------- */

.vwdcm-filter {
	padding-top: var(--vwdcm-gap);
}
.vwdcm .vwdcm-filter-input {
	width: 100%;
	padding: 0.7em 0.9em;
	border: 1px solid var(--vwdcm-line);
	border-radius: 0;
	background: #fff;
	font: inherit;
	font-size: 0.85em;
	color: var(--vwdcm-text);
}
.vwdcm .is-filtered-out {
	display: none !important;
}
.vwdcm-no-results {
	padding: 0.8em 0;
	font-size: 0.85em;
	color: var(--vwdcm-muted);
}

.vwdcm-notice {
	padding: 0.8em 1em;
	border-left: 4px solid #d63638;
	background: #fcf0f1;
	font-size: 14px;
}

/* ==========================================================================
   Grid
   ========================================================================== */

.vwdcm-grid {
	display: grid;
	grid-template-columns: repeat(var(--vwdcm-cols, 2), minmax(0, 1fr));
	gap: 40px;
	margin-bottom: 40px;
}
@media (max-width: 980px) {
	.vwdcm-grid {
		grid-template-columns: repeat(min(var(--vwdcm-cols, 2), 2), minmax(0, 1fr));
		gap: 24px;
	}
}
@media (max-width: 640px) {
	.vwdcm-grid {
		grid-template-columns: minmax(0, 1fr);
	}
}
.vwdcm-grid-heading {
	margin: 10px 0 20px;
	padding-bottom: 0;
}

.vwdcm-card {
	position: relative;
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid var(--vwdcm-line);
	transition: box-shadow var(--vwdcm-speed), border-color var(--vwdcm-speed);
}
.vwdcm-card:hover {
	border-color: #c8c8c8;
	box-shadow: 0 6px 22px rgba(0, 0, 0, 0.07);
}
.vwdcm-card-media img {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}
.vwdcm-card-body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	padding: 36px 38px;
}
.vwdcm-grid-wrap .vwdcm-card-title {
	margin: 0 0 14px;
	padding: 0;
	font-size: 1.6em;
	line-height: 1.15;
}
.vwdcm-card-link {
	color: inherit;
	text-decoration: none;
}
/* Whole card is clickable */
.vwdcm-card-link::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}
.vwdcm-card-link:focus-visible {
	outline: none;
}
.vwdcm-card:focus-within {
	outline: 2px solid var(--vwdcm-accent);
	outline-offset: 2px;
}
.vwdcm-grid-wrap .vwdcm-card-meta {
	margin: 0 0 14px;
	padding: 0;
	color: var(--vwdcm-muted);
}
.vwdcm-card-excerpt {
	color: var(--vwdcm-muted);
	margin-bottom: 14px;
}
.vwdcm-card-more {
	margin-top: auto;
	color: var(--vwdcm-accent);
}

/* Subcategory ("topic") cards look like folders rather than articles */
.vwdcm-card--term {
	background: var(--vwdcm-item-bg);
	border-color: transparent;
	border-top: 5px solid var(--vwdcm-accent);
}
.vwdcm-card--term .vwdcm-card-title::before {
	content: "";
	display: inline-block;
	width: 0.8em;
	height: 0.8em;
	margin-right: 0.35em;
	vertical-align: -0.02em;
	background: var(--vwdcm-accent);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 6a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 6a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.vwdcm-card--term:hover {
	background: #fff;
	border-color: var(--vwdcm-line);
	border-top-color: var(--vwdcm-accent);
}
.vwdcm-card--term .vwdcm-card-more::after {
	content: " \2192";
}

.vwdcm-empty {
	color: var(--vwdcm-muted);
}

.vwdcm-pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 40px;
}
.vwdcm-pagination .page-numbers {
	display: inline-block;
	padding: 0.45em 0.85em;
	border: 1px solid var(--vwdcm-line);
	color: var(--vwdcm-text);
	text-decoration: none;
}
.vwdcm-pagination .page-numbers.current,
.vwdcm-pagination a.page-numbers:hover {
	background: var(--vwdcm-accent);
	border-color: var(--vwdcm-accent);
	color: var(--vwdcm-accent-text);
}
.vwdcm-pagination .dots {
	border-color: transparent;
}

/* ==========================================================================
   Directory layout (library landing page)
   ========================================================================== */

.vwdcm-directory-wrap {
	--vwdcm-cols: 3;
}
.vwdcm-directory-summary {
	margin: 0 0 30px;
	padding: 0 0 0 18px;
	border-left: var(--vwdcm-bar) solid var(--vwdcm-accent);
	font-size: 1.25em;
	line-height: 1.4;
	color: var(--vwdcm-muted);
}
.vwdcm-directory-summary strong {
	color: var(--vwdcm-text);
}
.vwdcm-directory {
	gap: 28px;
}
.vwdcm-dir-card {
	display: flex;
	flex-direction: column;
	background: var(--vwdcm-item-bg);
	border-top: 5px solid var(--vwdcm-accent);
	padding: 26px 28px 24px;
	transition: box-shadow var(--vwdcm-speed), background-color var(--vwdcm-speed);
}
.vwdcm-dir-card:hover {
	background: #fff;
	box-shadow: 0 6px 22px rgba(0, 0, 0, 0.07);
}
.vwdcm-dir-head {
	margin-bottom: 14px;
}
.vwdcm-grid-wrap .vwdcm-dir-title {
	margin: 0 0 4px;
	padding: 0;
	font-size: 1.35em;
	line-height: 1.2;
}
.vwdcm-dir-title a {
	color: inherit;
	text-decoration: none;
}
.vwdcm-dir-title a:hover {
	color: var(--vwdcm-accent);
}
.vwdcm-dir-count {
	font-size: 0.85em;
	color: var(--vwdcm-muted);
}
.vwdcm-grid-wrap ul.vwdcm-dir-list,
.vwdcm-grid-wrap ul.vwdcm-dir-list li {
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
}
.vwdcm-grid-wrap ul.vwdcm-dir-list {
	margin-bottom: 16px !important;
	border-top: 1px solid var(--vwdcm-line);
}
.vwdcm-dir-list li {
	border-bottom: 1px solid var(--vwdcm-line);
}
.vwdcm-dir-list a {
	display: flex;
	align-items: center;
	gap: 0.55em;
	padding: 0.55em 0;
	font-size: 0.92em;
	line-height: 1.3;
	color: var(--vwdcm-text);
	text-decoration: none;
}
.vwdcm-dir-list a:hover {
	color: var(--vwdcm-accent);
}
.vwdcm-dir-list a::before {
	content: "";
	flex: 0 0 auto;
	width: 0.9em;
	height: 0.9em;
	background: var(--vwdcm-muted);
	opacity: 0.7;
}
.vwdcm-dir-sub a::before {
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 6a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 6a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.vwdcm-dir-post a::before {
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M3 1h9l6 6v15a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1z'/%3E%3Cpath d='M12 1v6h6M6 13h8M6 17h8'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M3 1h9l6 6v15a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1z'/%3E%3Cpath d='M12 1v6h6M6 13h8M6 17h8'/%3E%3C/svg%3E") center / contain no-repeat;
}
.vwdcm-dir-list a:hover::before {
	background: var(--vwdcm-accent);
	opacity: 1;
}
.vwdcm-dir-list .vwdcm-count {
	margin-left: auto;
}
.vwdcm-dir-more {
	margin-top: auto;
	color: var(--vwdcm-accent);
	text-decoration: none;
}
.vwdcm-dir-more::after {
	content: " \2192";
}
.vwdcm-editor-notice {
	margin-top: 30px;
}
.vwdcm-editor-notice ul {
	margin: 0.5em 0 0 1.2em;
}
