/* WM List Content — frontend */

.wm-lc { box-sizing: border-box; }

.wm-lc-date {
	display: block;
	width: 100%;
	margin: 0;
	line-height: 1.3;
	font-size: var(--wm-lc-date-fs, inherit);
	text-align: var(--wm-lc-date-align, inherit);
	color: var(--wm-lc-date-c, inherit);
	opacity: 0.85;
}
.wm-lc-free,
.wm-lc-card__free {
	display: block;
	width: 100%;
	margin: 0;
	margin-top: var(--wm-lc-free-mt, 0px);
	line-height: 1.55;
	font-size: var(--wm-lc-free-fs, 0.88rem);
	text-align: var(--wm-lc-free-align, inherit);
	color: var(--wm-lc-free-c, var(--wm-lc-excerpt-c, inherit));
	opacity: 0.88;
	white-space: pre-line;
}

/* ── Image menu ─────────────────────────────────────────────────────────── */
.wm-lc--menu {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wm-lc-gap, 12px);
	justify-content: var(--wm-lc-justify, center);
	align-items: stretch;
	height: inherit;
}
.wm-lc--menu.is-gap-mobile { gap: 0; }

.wm-lc--menu.is-justify-left { --wm-lc-justify: flex-start; }
.wm-lc--menu.is-justify-center { --wm-lc-justify: center; }
.wm-lc--menu.is-justify-right { --wm-lc-justify: flex-end; }
.wm-lc--menu.is-justify-space-between { --wm-lc-justify: space-between; }

.wm-lc--menu.is-pinned {
	position: sticky;
	top: 0;
	z-index: 5;
	margin-top: 0;
	padding: 4px 0;
	background-color: var(--wm-lc-body-bg, transparent);
}

.wm-lc--menu.is-narrow-scroll {
	flex-wrap: nowrap;
	overflow-x: auto;
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
}

.wm-lc--menu.is-narrow-scroll .wm-lc-item { flex-shrink: 0; }

.wm-lc--menu .wm-lc-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: space-between;
	text-decoration: none;
	text-align: center;
	transition: opacity 0.2s ease;
	border-radius: var(--wm-lc-radius, 0);
	border: var(--wm-lc-border, 0 solid transparent);
	padding: var(--wm-lc-pad, 12px);
	padding-bottom: max(16px, var(--wm-lc-pad, 12px));
	overflow: hidden;
	box-sizing: border-box;
}

.wm-lc--menu.has-item-width .wm-lc-item {
	flex: 0 0 var(--wm-lc-item-w);
	width: var(--wm-lc-item-w);
	max-width: 100%;
	min-width: 0;
}

.wm-lc--menu .wm-lc-item:hover { opacity: 0.88; }

/* Use hover-colors: PHP sätter --wm-lc-item-bg + --wm-lc-title-c, hover byter plats */
.wm-lc--menu.has-hover-reverse .wm-lc-item {
	transition: background-color 0.7s ease, color 0.7s ease, opacity 0.2s ease;
}
/* Keep color transitions when entrance anim also sets transition on the item */
.wm-lc--menu.has-hover-reverse.wm-lc-anim .wm-lc-anim-item {
	transition: opacity var(--wm-lc-anim-dur, 0.6s) ease, transform var(--wm-lc-anim-dur, 0.6s) ease, background-color 0.7s ease, color 0.7s ease;
}
.wm-lc--menu.has-hover-reverse .wm-lc-menu-title,
.wm-lc--menu.has-hover-reverse .wm-lc-menu-excerpt,
.wm-lc--menu.has-hover-reverse .wm-lc-date,
.wm-lc--menu.has-hover-reverse .wm-lc-free {
	transition: color 0.7s ease;
}
.wm-lc--menu.has-hover-reverse .wm-lc-item:hover,
.wm-lc--menu.has-hover-reverse .wm-lc-item:focus-visible {
	background-color: var(--wm-lc-title-c) !important;
	color: var(--wm-lc-item-bg);
	opacity: 1;
}
.wm-lc--menu.has-hover-reverse .wm-lc-item:hover .wm-lc-menu-title,
.wm-lc--menu.has-hover-reverse .wm-lc-item:focus-visible .wm-lc-menu-title,
.wm-lc--menu.has-hover-reverse .wm-lc-item:hover .wm-lc-menu-excerpt,
.wm-lc--menu.has-hover-reverse .wm-lc-item:focus-visible .wm-lc-menu-excerpt,
.wm-lc--menu.has-hover-reverse .wm-lc-item:hover .wm-lc-date,
.wm-lc--menu.has-hover-reverse .wm-lc-item:focus-visible .wm-lc-date,
.wm-lc--menu.has-hover-reverse .wm-lc-item:hover .wm-lc-free,
.wm-lc--menu.has-hover-reverse .wm-lc-item:focus-visible .wm-lc-free {
	color: var(--wm-lc-item-bg) !important;
}
.wm-lc-menu-title,
.wm-lc-menu-excerpt {
	display: block;
	width: 100%;
	max-width: 94%;
	line-height: 1.3;
	margin: 0;
}
.wm-lc-menu-title {
	text-align: var(--wm-lc-title-align, center);
	color: var(--wm-lc-title-c, inherit);
	margin-top: var(--wm-lc-title-mt, 0px);
}
.wm-lc-menu-excerpt {
	text-align: var(--wm-lc-excerpt-align, center);
	font-size: var(--wm-lc-excerpt-fs, inherit);
	color: var(--wm-lc-excerpt-c, inherit);
	margin-top: var(--wm-lc-excerpt-mt, 0px);
}
.wm-lc--menu .wm-lc-date,
.wm-lc--menu .wm-lc-free,
.wm-lc--menu .wm-lc-menu-btn {
	max-width: 94%;
}
.wm-lc--menu .wm-lc-menu-btn {
	width: 100%;
	display: flex;
	justify-content: var(--wm-lc-btn-align, center);
	align-self: var(--wm-lc-btn-align, center);
}
.wm-lc-menu-image {
	display: block;
	width: var(--wm-lc-img-w, auto);
	height: var(--wm-lc-img-h, auto);
	max-width: 100%;
	object-fit: var(--wm-lc-img-fit, cover);
}
.wm-lc--menu.has-img-box .wm-lc-menu-image {
	width: var(--wm-lc-img-w, 100%);
	height: var(--wm-lc-img-h);
	object-fit: var(--wm-lc-img-fit, cover);
}
.wm-lc--menu.is-fluid-img { container-type: inline-size; }
.wm-lc--menu.is-fluid-img .wm-lc-menu-image {
	width: calc(100cqi / var(--wm-lc-n, 1) * var(--wm-lc-img-reduce, 1));
	height: var(--wm-lc-img-h, auto);
}
.wm-lc--menu.is-fluid-img.is-row .wm-lc-menu-image {
	flex: 0 0 calc(100cqi / var(--wm-lc-n, 1) * var(--wm-lc-img-reduce, 1));
}

.wm-lc--menu.is-row .wm-lc-item { align-items: stretch; }
.wm-lc--menu.is-row .wm-lc-menu-row {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 0.75em;
	width: 100%;
	min-width: 0;
}
.wm-lc--menu.is-row .wm-lc-menu-image { flex-shrink: 0; }
.wm-lc--menu.is-row .wm-lc-menu-text {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
	flex: 1 1 auto;
	align-items: var(--wm-lc-btn-align, center);
}
.wm-lc .wp-element-button { margin-top: var(--wm-lc-btn-mt, 6px); }
.wm-lc--menu .wm-lc-menu-btn .wp-element-button { align-self: auto; margin-top: var(--wm-lc-btn-mt, 6px); }

/* ── Hover cards ────────────────────────────────────────────────────────── */
.wm-lc--hover {
	display: grid;
	gap: var(--wm-lc-gap, 12px);
	grid-template-columns: repeat(var(--wm-lc-cols, 3), 1fr);
}

.wm-lc-card {
	position: relative;
	height: var(--card-height, 400px);
	overflow: hidden;
	border-radius: var(--wm-lc-radius, 0);
	border: var(--wm-lc-border, 0 solid transparent);
}

.wm-lc--hover-auto .wm-lc-card {
	height: auto;
}

.wm-lc-card__img { position: absolute; inset: 0; }
.wm-lc-card__img--empty { background: #e8e8e8; }
.wm-lc--hover-auto .wm-lc-card__img {
	position: relative;
	inset: auto;
	aspect-ratio: 4 / 3;
	overflow: hidden;
}
.wm-lc-card__img img {
	width: 100%;
	height: 100%;
	object-fit: var(--wm-lc-img-fit, cover);
	display: block;
	transition: transform 0.45s ease;
}
.wm-lc--hover-auto .wm-lc-card__img img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: var(--wm-lc-img-fit, cover);
}
.wm-lc-card--fit-contain .wm-lc-card__img img { object-fit: contain; }
.wm-lc-card--fit-contain.wm-lc--hover-auto .wm-lc-card__img img,
.wm-lc--hover-auto .wm-lc-card--fit-contain .wm-lc-card__img img {
	object-fit: contain;
}
.wm-lc-card:hover .wm-lc-card__img img,
.wm-lc-card:focus-within .wm-lc-card__img img { transform: scale(1.07); }

.wm-lc-card__overlay {
	position: absolute;
	inset: 0;
	background: #000;
	opacity: 0;
	transition: opacity 0.45s ease;
}
.wm-lc-card:hover .wm-lc-card__overlay,
.wm-lc-card:focus-within .wm-lc-card__overlay {
	opacity: var(--overlay-opacity, 0.5);
}

.wm-lc-card__content {
	position: absolute;
	inset: 0;
	z-index: 1;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	align-items: center;
	gap: 0.4rem;
	padding: var(--wm-lc-pad, 12px);
	padding-bottom: max(16px, var(--wm-lc-pad, 12px));
	opacity: 0;
	transform: translateY(10px);
	transition: opacity 0.4s ease, transform 0.4s ease;
	text-align: center;
	box-sizing: border-box;
}
.wm-lc--v-top .wm-lc-card__content { justify-content: flex-start; }
.wm-lc--v-center .wm-lc-card__content { justify-content: center; }
.wm-lc--v-bottom .wm-lc-card__content { justify-content: flex-end; }
.wm-lc-card:hover .wm-lc-card__content,
.wm-lc-card:focus-within .wm-lc-card__content {
	opacity: 1;
	transform: translateY(0);
}

.wm-lc-card__title {
	margin: 0;
	margin-top: var(--wm-lc-title-mt, 0px);
	width: 100%;
	max-width: 100%;
	min-width: 0;
	color: var(--wm-lc-title-c, inherit);
	line-height: 1.2;
}
.wm-lc-card__excerpt {
	margin: 0;
	margin-top: var(--wm-lc-excerpt-mt, 0px);
	width: 100%;
	max-width: 100%;
	min-width: 0;
	font-size: var(--wm-lc-excerpt-fs, 0.88rem);
	color: var(--wm-lc-excerpt-c, inherit);
	line-height: 1.55;
	opacity: 0.88;
}

/* ── Post list ──────────────────────────────────────────────────────────── */
.wm-lc--postlist { display: flex; flex-direction: column; }
.wm-lc--postlist .wm-lc-pl-head * { margin: 0; }
.wm-lc--postlist .wm-lc-post {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 0.6rem;
	margin-top: 0.6vw;
	padding: 8px;
	border-radius: 6px;
	text-decoration: none;
	background: var(--wm-pl-bg, var(--wp--preset--color--light-2));
	color: var(--wm-pl-fg, var(--wp--preset--color--dark-3));
}
.wm-lc--postlist .wm-lc-post:hover,
.wm-lc--postlist .wm-lc-post:focus-visible {
	background: var(--wm-pl-fg, var(--wp--preset--color--dark-3));
	color: var(--wm-pl-bg, var(--wp--preset--color--light-2));
}
.wm-lc--postlist .wm-lc-post img {
	width: var(--wm-pl-img, 20%);
	height: auto;
	display: block;
	object-fit: cover;
	flex-shrink: 0;
}
.wm-lc--postlist .wm-lc-post img.is-square { aspect-ratio: 1 / 1; }
.wm-lc--postlist .wm-lc-posttext { display: block; min-width: 0; }
.wm-lc--postlist .wm-lc-date,
.wm-lc--postlist .wm-lc-menu-title,
.wm-lc--postlist .wm-lc-menu-excerpt,
.wm-lc--postlist .wm-lc-free {
	margin: 0;
	display: block;
	width: auto;
	max-width: 100%;
	text-align: start;
}
