/* Cards */
.wpp-card { cursor: pointer; }
.wpp-card:focus-visible { outline: 2px solid var(--wpp-accent, #b59a75); outline-offset: 3px; }

html.wpp-lock { overflow: hidden; }

/* Modal shell */
.wpp {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	font-family: var(--wpp-font, inherit);
	opacity: 0;
	transition: opacity .2s ease;
}
.wpp[hidden] { display: none; }
.wpp.is-open { opacity: 1; }

.wpp__overlay {
	position: absolute;
	inset: 0;
	background: var(--wpp-overlay, rgba(0,0,0,.85));
}

/* Dialog */
.wpp__dialog {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 0 48px;
	width: 100%;
	max-width: var(--wpp-max-width, 920px);
	max-height: calc(100vh - 48px);
	padding: 16px;
	background: var(--wpp-panel, #f4efe6);
	box-sizing: border-box;
	outline: none;
	transform: translateY(8px);
	transition: transform .2s ease;
}
.wpp.is-open .wpp__dialog { transform: none; }
.wpp__dialog.has-no-image { grid-template-columns: minmax(0, 1fr); }

/* Image column */
.wpp__media {
	min-height: 0;
	height: min(617px, calc(100vh - 80px));
	background: rgba(0,0,0,.06);
}
.wpp__media[hidden] { display: none; }
.wpp__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Text column */
.wpp__body {
	display: flex;
	flex-direction: column;
	min-height: 0;
	min-width: 0;
	max-height: min(617px, calc(100vh - 80px));
	padding: 16px 16px 0 0;
}
.wpp__scroll {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	padding-right: 8px;
	outline: none;
	scrollbar-width: thin;
}
.wpp__scroll:focus-visible { outline: 2px solid var(--wpp-accent, #b59a75); outline-offset: 2px; }

.wpp__title {
	margin: 0 56px 24px 0;
	padding: 0;
	font-family: inherit;
	font-size: var(--wpp-title-size, 26px);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.01em;
	color: var(--wpp-title, #3b3229);
}
.wpp__year {
	font-size: var(--wpp-year-size, 17px);
	font-weight: 400;
	letter-spacing: 0;
	color: var(--wpp-year, #3b3229);
}
.wpp__year[hidden] { display: none; }

.wpp__content {
	font-size: var(--wpp-text-size, 17px);
	line-height: 1.45;
	color: var(--wpp-text, #77716a);
}
.wpp__content > :first-child { margin-top: 0; }
.wpp__content > :last-child { margin-bottom: 0; }
.wpp__content p { margin: 0 0 1em; }
.wpp__content img { max-width: 100%; height: auto; }

.wpp__cats {
	margin: 20px 0 0;
	font-size: calc(var(--wpp-text-size, 17px) - 3px);
	color: var(--wpp-text, #77716a);
}
.wpp__cats[hidden] { display: none; }

/* Prev and next */
.wpp__nav {
	flex: 0 0 auto;
	display: flex;
	gap: 16px;
	padding: 24px 0 16px;
}
.wpp__nav[hidden] { display: none; }
.wpp__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	margin: 0;
	padding: 0;
	border: 1px solid var(--wpp-accent, #b59a75);
	border-radius: 0;
	background: transparent;
	color: var(--wpp-accent, #b59a75);
	cursor: pointer;
	transition: background-color .15s ease, color .15s ease;
}
.wpp__btn:hover,
.wpp__btn:focus-visible {
	background: var(--wpp-accent, #b59a75);
	color: var(--wpp-panel, #f4efe6);
}
.wpp__btn:focus-visible { outline: 2px solid var(--wpp-title, #3b3229); outline-offset: 2px; }

/* Close */
.wpp__close {
	position: absolute;
	top: 16px;
	right: 16px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: var(--wpp-close-bg, #3b3229);
	color: var(--wpp-close-icon, #fff);
	cursor: pointer;
}
.wpp__close:hover { opacity: .88; }
.wpp__close:focus-visible { outline: 2px solid var(--wpp-accent, #b59a75); outline-offset: 2px; }

/* Loading and error */
.wpp.is-loading .wpp__body { opacity: .45; transition: opacity .15s ease; }
.wpp.is-error .wpp__media { display: none; }

/* Mobile: stack */
@media (max-width: 767px) {
	.wpp { padding: 12px; }
	.wpp__dialog {
		grid-template-columns: minmax(0, 1fr);
		gap: 0;
		max-height: calc(100vh - 24px);
		overflow-y: auto;
		padding: 12px;
	}
	.wpp__media { height: auto; aspect-ratio: 4 / 5; max-height: 45vh; }
	.wpp__body { max-height: none; padding: 20px 0 0; }
	.wpp__scroll { overflow: visible; padding: 0; }
	.wpp__close { top: 20px; right: 20px; width: 44px; height: 44px; }
	.wpp__title { margin-right: 0; }
}

@media (prefers-reduced-motion: reduce) {
	.wpp, .wpp__dialog, .wpp__btn, .wpp__body { transition: none; }
	.wpp__dialog { transform: none; }
}
