/**
 * Resource single detail page styles.
 */

.liwg-resource-single {
	padding: 64px 20px;
	background-color: #f4f7fc;
}

.liwg-resource-single__inner {
	max-width: 1240px;
	margin: 0 auto;
}

.liwg-resource-single__grid {
	display: grid;
	grid-template-columns: minmax(0, 280px) minmax(0, 1fr) minmax(0, 280px);
	grid-template-areas: "cover center aside";
	gap: 40px 48px;
	align-items: start;
}

.liwg-resource-single__content {
	display: contents;
}

.liwg-resource-single__cover {
	grid-area: cover;
}

.liwg-resource-single__cover-image {
	display: block;
	width: 100%;
	height: auto;
	border: 0;
	border-radius: 8px;
	box-shadow: 0 2px 10px rgba(17, 17, 17, 0.06);
}

.liwg-resource-single__cover-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 280px;
	border-radius: 8px;
	background-color: #c5d6e3;
	box-shadow: 0 2px 10px rgba(17, 17, 17, 0.06);
}

.liwg-resource-single__cover-icon {
	display: flex;
	color: #16557b;
}

.liwg-resource-icon {
	width: 52px;
	height: 52px;
}

/* Center column */

.liwg-resource-single__center {
	grid-area: center;
	min-width: 0;
}

.liwg-resource-single__title {
	margin: 0 0 20px;
	color: #111111;
	font-size: 32px;
	font-weight: 700;
	line-height: 1.25;
}

.liwg-resource-single__description {
	margin-bottom: 24px;
	color: #767676;
	font-size: 15px;
	line-height: 1.6;
}

.liwg-resource-single__description p {
	margin: 0 0 12px;
}

.liwg-resource-single__description p:last-child {
	margin-bottom: 0;
}

/* Right column */

.liwg-resource-single__aside {
	grid-area: aside;
	min-width: 0;
	padding: 24px 20px;
	border-radius: 8px;
	background-color: #ffffff;
}

.liwg-resource-single__aside-action {
	margin-bottom: 0;
}

.liwg-resource-single__aside-top {
	display: flex;
	flex-direction: column;
	gap: 20px;
	margin-bottom: 0;
}

.liwg-resource-single__aside-top + .liwg-resource-single__aside-divider {
	margin-top: 20px;
}

.liwg-resource-single__aside-action .liwg-btn {
	width: 100%;
}

.liwg-resource-single__meta {
	margin: 0;
	color: #767676;
	font-size: 14px;
	line-height: 1.5;
}

.liwg-resource-single__aside-divider {
	height: 1px;
	margin: 20px 0;
	background-color: #d4dde8;
}

.liwg-resource-single__aside-tags {
	margin-top: 0;
}

.liwg-resource-single .liwg-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 12px 28px;
	border: 2px solid transparent;
	border-radius: 4px;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.liwg-resource-single .liwg-btn--primary {
	background-color: #16557b;
	border-color: #16557b;
	color: #ffffff;
}

.liwg-resource-single .liwg-btn--primary:hover,
.liwg-resource-single .liwg-btn--primary:focus {
	background-color: #222222;
	border-color: #222222;
	color: #ffffff;
}

.liwg-resource-single .liwg-btn--secondary {
	background-color: transparent;
	border-color: #16557b;
	color: #16557b;
}

.liwg-resource-single .liwg-btn--secondary:hover,
.liwg-resource-single .liwg-btn--secondary:focus {
	background-color: #16557b;
	color: #ffffff;
}

/* Materials list */

.liwg-resource-single__materials {
	margin-top: 8px;
}

.liwg-resource-single__materials-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.liwg-resource-single__materials-item + .liwg-resource-single__materials-item {
	margin-top: 4px;
}

.liwg-resource-single__materials-link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 0;
	border: 0;
	background: none;
	color: #16557b;
	font: inherit;
	text-align: left;
	text-decoration: none;
	cursor: pointer;
	transition: color 0.2s ease;
}

.liwg-resource-single__materials-link:hover,
.liwg-resource-single__materials-link:focus {
	color: #222222;
}

.liwg-resource-single__materials-link--static {
	cursor: default;
}

.liwg-resource-single__materials-link--static:hover,
.liwg-resource-single__materials-link--static:focus {
	color: #16557b;
}

.liwg-resource-single__materials-icon {
	display: flex;
	flex-shrink: 0;
	width: 24px;
	height: 24px;
}

.liwg-resource-single__materials-icon .liwg-resource-icon {
	width: 24px;
	height: 24px;
}

.liwg-resource-single__materials-label {
	font-size: 14px;
	font-weight: 600;
	line-height: 1.35;
}

/* Gallery */

.liwg-resource-single__gallery {
	margin-top: 32px;
}

.liwg-resource-single__gallery-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.liwg-resource-single__gallery-trigger {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	border-radius: 4px;
	background: none;
	cursor: pointer;
	overflow: hidden;
}

.liwg-resource-single__gallery-trigger:focus-visible {
	outline: 2px solid #16557b;
	outline-offset: 2px;
}

.liwg-resource-single__gallery-thumb {
	display: block;
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
}

/* Term badges (right column) */

.liwg-resource-single__aside-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: flex-start;
}

.liwg-resource-single__aside-tags .liwg-resource-card__tags {
	display: contents;
}

.liwg-resource-single__aside-tags .liwg-resource-card__tags li {
	margin: 0;
	max-width: 100%;
}

.liwg-resource-single__aside-tags .liwg-resource-card__tags .liwg-resource-card__tag {
	padding: 5px 12px;
	border: 2px solid transparent;
	max-width: 100%;
	white-space: normal;
	text-align: center;
}

.liwg-resource-single__aside-tags .liwg-resource-card__tag--project,
.liwg-resource-single__aside-tags a.liwg-resource-card__tag--project {
	border-color: #ea6a56;
	background-color: #ea6a56;
	color: #ffffff;
	box-shadow: none;
	text-decoration: none;
}

.liwg-resource-single__aside-tags a.liwg-resource-card__tag--project:hover,
.liwg-resource-single__aside-tags a.liwg-resource-card__tag--project:focus {
	border-color: #222222;
	background-color: #222222;
	color: #ffffff;
}

.liwg-resource-single__aside-tags a.liwg-resource-card__tag--topic {
	border-color: transparent;
	background-color: #e8eef5;
	color: #16557b;
}

.liwg-resource-single__aside-tags a.liwg-resource-card__tag--topic:hover,
.liwg-resource-single__aside-tags a.liwg-resource-card__tag--topic:focus {
	border-color: #222222;
	background-color: #222222;
	color: #ffffff;
}

/* Audio lightbox */

.liwg-audio-lightbox {
	display: flex;
	position: fixed;
	inset: 0;
	z-index: 100000;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.liwg-audio-lightbox[hidden] {
	display: none !important;
}

.liwg-audio-lightbox__backdrop {
	position: absolute;
	inset: 0;
	background-color: rgba(17, 17, 17, 0.72);
}

.liwg-audio-lightbox__dialog {
	position: relative;
	z-index: 1;
	width: min(560px, 100%);
	padding: 28px 24px 24px;
	border-radius: 8px;
	background-color: #ffffff;
	box-shadow: 0 16px 48px rgba(17, 17, 17, 0.35);
}

.liwg-audio-lightbox__title {
	margin: 0 0 16px;
	padding-right: 88px;
	color: #111111;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.35;
}

.liwg-audio-lightbox__toolbar {
	display: flex;
	position: absolute;
	top: 16px;
	right: 16px;
	align-items: center;
	gap: 8px;
}

.liwg-audio-lightbox__icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 4px;
	background-color: #f4f7fc;
	color: #222222;
	font-size: 24px;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.liwg-audio-lightbox__icon-btn:hover,
.liwg-audio-lightbox__icon-btn:focus {
	background-color: #16557b;
	color: #ffffff;
}

.liwg-audio-lightbox__icon-svg {
	width: 20px;
	height: 20px;
}

.liwg-audio-lightbox__close {
	font-size: 24px;
	line-height: 1;
}

.liwg-audio-lightbox__player {
	display: block;
	width: 100%;
}

body.liwg-audio-lightbox-open {
	overflow: hidden;
}

/* Image lightbox */

.liwg-image-lightbox {
	display: flex;
	position: fixed;
	inset: 0;
	z-index: 100000;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.liwg-image-lightbox[hidden] {
	display: none !important;
}

.liwg-image-lightbox__backdrop {
	position: absolute;
	inset: 0;
	background-color: rgba(17, 17, 17, 0.72);
}

.liwg-image-lightbox__dialog {
	display: flex;
	flex-direction: column;
	position: relative;
	z-index: 1;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 100%;
	max-width: min(1120px, calc(100vw - 40px));
	height: calc(100dvh - 40px);
	max-height: calc(100dvh - 40px);
	background: transparent;
	box-shadow: none;
}

.liwg-image-lightbox__stage {
	display: grid;
	flex: 1 1 auto;
	grid-template-columns: auto minmax(0, max-content) auto;
	grid-template-areas: "prev figure next";
	align-content: center;
	align-items: center;
	justify-content: center;
	justify-items: center;
	gap: 12px;
	width: 100%;
	min-height: 0;
	touch-action: pan-y pinch-zoom;
}

.liwg-image-lightbox__nav--prev {
	grid-area: prev;
}

.liwg-image-lightbox__frame {
	position: relative;
	grid-area: figure;
	width: fit-content;
	max-width: 100%;
	justify-self: center;
}

.liwg-image-lightbox__nav--next {
	grid-area: next;
}

.liwg-image-lightbox__toolbar {
	display: flex;
	position: absolute;
	top: 0;
	left: calc(100% + 8px);
	z-index: 3;
	flex-shrink: 0;
	align-items: center;
	gap: 8px;
}

.liwg-image-lightbox__icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 4px;
	background-color: #ffffff;
	color: #222222;
	font-size: 28px;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.liwg-image-lightbox__icon-btn:hover,
.liwg-image-lightbox__icon-btn:focus {
	background-color: #16557b;
	color: #ffffff;
}

.liwg-image-lightbox__icon-svg {
	width: 22px;
	height: 22px;
}

.liwg-image-lightbox__nav {
	display: flex;
	position: relative;
	z-index: 2;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 4px;
	background-color: rgba(255, 255, 255, 0.92);
	color: #222222;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.liwg-image-lightbox__nav[hidden] {
	display: none;
}

.liwg-image-lightbox__nav:hover,
.liwg-image-lightbox__nav:focus {
	background-color: #16557b;
	color: #ffffff;
}

.liwg-image-lightbox__figure {
	display: block;
	min-width: 0;
	max-width: 100%;
	margin: 0;
	line-height: 0;
}

.liwg-image-lightbox__image {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: calc(100dvh - 80px);
	object-fit: contain;
}

.liwg-image-lightbox__footer {
	display: flex;
	position: absolute;
	bottom: 0;
	left: calc(100% + 8px);
	z-index: 3;
	align-items: flex-end;
	padding: 0;
}

.liwg-image-lightbox__counter {
	margin: 0;
	color: #ffffff;
	font-size: 14px;
	line-height: 1.4;
	white-space: nowrap;
	text-shadow: 0 1px 2px rgba(17, 17, 17, 0.45);
}

.liwg-image-lightbox__counter:empty {
	display: none;
}

body.liwg-image-lightbox-open {
	overflow: hidden;
}

@media (max-width: 1279px) {
	.liwg-image-lightbox {
		padding: 16px;
	}

	.liwg-image-lightbox__dialog {
		max-width: calc(100vw - 32px);
		height: calc(100dvh - 32px);
		max-height: calc(100dvh - 32px);
	}

	.liwg-image-lightbox__image {
		max-height: calc(100dvh - 64px);
	}
}

@media (max-width: 1279px) and (orientation: portrait) {
	.liwg-image-lightbox__stage {
		grid-template-columns: 1fr auto 1fr;
		grid-template-areas:
			"toolbar toolbar toolbar"
			"figure figure figure"
			"prev counter next";
	}

	.liwg-image-lightbox__frame {
		display: contents;
	}

	.liwg-image-lightbox__toolbar {
		grid-area: toolbar;
		position: static;
		width: 100%;
		justify-content: flex-end;
		padding-bottom: 8px;
	}

	.liwg-image-lightbox__figure {
		grid-area: figure;
		justify-self: center;
		width: fit-content;
		max-width: 100%;
	}

	.liwg-image-lightbox__footer {
		grid-area: counter;
		position: static;
		justify-self: center;
		align-self: center;
		padding: 0;
	}

	.liwg-image-lightbox__nav--prev {
		grid-area: prev;
		justify-self: end;
	}

	.liwg-image-lightbox__nav--next {
		grid-area: next;
		justify-self: start;
	}

	.liwg-image-lightbox__image {
		max-height: calc(100dvh - 148px);
	}
}

@media (max-width: 478px) {
	.liwg-image-lightbox {
		padding: 12px;
	}

	.liwg-image-lightbox__dialog {
		height: calc(100dvh - 24px);
		max-height: calc(100dvh - 24px);
	}
}

/* Tablet / mobile stack */

@media (max-width: 1279px) and (min-width: 479px) {
	.liwg-resource-single__grid {
		grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
		grid-template-areas: "cover content";
		gap: 32px;
		align-items: start;
	}

	.liwg-resource-single__content {
		display: flex;
		flex-direction: column;
		gap: 32px;
		grid-area: content;
		min-width: 0;
	}

	.liwg-resource-single__center,
	.liwg-resource-single__aside {
		grid-area: auto;
	}

	.liwg-resource-single__aside-top {
		flex-direction: row;
		align-items: center;
		gap: 16px;
	}

	.liwg-resource-single__aside-action {
		flex: 0 0 148px;
	}

	.liwg-resource-single__meta {
		flex: 1;
		min-width: 0;
	}

	.liwg-resource-single__title {
		font-size: 28px;
	}

	.liwg-resource-single__gallery-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

@media (max-width: 478px) {
	.liwg-resource-single__grid {
		grid-template-columns: minmax(0, 1fr);
		grid-template-areas: "cover" "content";
		gap: 32px;
	}

	.liwg-resource-single__content {
		display: flex;
		flex-direction: column;
		gap: 32px;
		grid-area: content;
	}

	.liwg-resource-single__center,
	.liwg-resource-single__aside {
		grid-area: auto;
	}

	.liwg-resource-single__aside-top {
		flex-direction: column;
	}

	.liwg-resource-single {
		padding: 48px 20px;
	}

	.liwg-resource-single__title {
		font-size: 24px;
		margin-bottom: 16px;
	}

	.liwg-resource-single__gallery-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.liwg-resource-single .liwg-btn {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.liwg-resource-single .liwg-btn,
	.liwg-resource-single__materials-link {
		transition: none;
	}
}
