/* ----------------------------------------------------------------------
 * Publications — card helpers + scrollable gallery popup
 * ---------------------------------------------------------------------- */

:root {
	--ha2d-pub-accent: #b78a4e;
	--ha2d-pub-modal-bg: #000;
	--ha2d-pub-modal-fg: #fff;
	--ha2d-pub-modal-width: 78rem;
	--ha2d-pub-radius: 6px;
	--ha2d-pub-z: 99999;
}

/* Card ---------------------------------------------------------------- */

/* Set by JS on the card that owns a trigger, so the overlay can stretch. */
.ha2d-pub-has-trigger {
	position: relative;
}

/* Full-card click layer. Sits under any real link inside the card. */
.ha2d-pub-trigger {
	position: absolute;
	inset: 0;
	z-index: 1;
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	text-align: inherit;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.ha2d-pub-trigger:focus-visible {
	outline: 2px solid var(--ha2d-pub-accent);
	outline-offset: 3px;
}

/* "View ↗" badge shown only on cards that open a popup. */
.ha2d-pub-badge {
	position: absolute;
	top: 1.6rem;
	right: 1.6rem;
	display: inline-flex;
	align-items: center;
	gap: .5em;
	padding: .5em 1em;
	border-radius: 3px;
	background: rgba(20, 20, 20, .85);
	color: #fff;
	font-size: 1.2rem;
	letter-spacing: .08em;
	text-transform: uppercase;
	line-height: 1;
	opacity: 0;
	transform: translateY(-4px);
	transition: opacity .25s ease, transform .25s ease;
	pointer-events: none;
}

.ha2d-pub-has-trigger:hover .ha2d-pub-badge,
.ha2d-pub-trigger:focus-visible .ha2d-pub-badge {
	opacity: 1;
	transform: translateY(0);
}

/* Visible "Read Article ↗" button. Must sit above the overlay. */
/* .ha2d-pub-link {
	position: relative;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	gap: .4em;
	color: var(--ha2d-pub-accent);
	font-size: 1.3rem;
	letter-spacing: .12em;
	text-transform: uppercase;
	text-decoration: none;
	line-height: 1.2;
	transition: opacity .2s ease;
} */

.ha2d-pub-link:hover,
.ha2d-pub-link:focus {
	opacity: .7;
	text-decoration: none;
}

.ha2d-pub-arrow::before {
	content: "\2197";
	display: inline-block;
	font-size: .95em;
}

/* Popup --------------------------------------------------------------- */

.ha2d-pub-modal {
	position: fixed;
	inset: 0;
	z-index: var(--ha2d-pub-z);
	background: var(--ha2d-pub-modal-bg);
	color: var(--ha2d-pub-modal-fg);
	opacity: 0;
	visibility: hidden;
	transition: opacity .25s ease, visibility .25s ease;
}

.ha2d-pub-modal.is-open {
	opacity: 1;
	visibility: visible;
}

.ha2d-pub-modal__backdrop {
	position: absolute;
	inset: 0;
}

.ha2d-pub-modal__dialog {
	position: relative;
	height: 100%;
}

/* The scrolling column: title, then featured image, then the gallery. */
.ha2d-pub-modal__scroll {
	position: relative;
	height: 100%;
	overflow-y: auto;
	overflow-x: hidden;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, .35) transparent;
	padding: 10rem 2rem 6rem;
}

.ha2d-pub-modal__scroll:focus {
	outline: none;
}

.ha2d-pub-modal__scroll::-webkit-scrollbar {
	width: 8px;
}

.ha2d-pub-modal__scroll::-webkit-scrollbar-thumb {
	border-radius: 4px;
	background: rgba(255, 255, 255, .3);
}

.ha2d-pub-modal__title {
	max-width: var(--ha2d-pub-modal-width);
	margin: 0 auto 3rem;
	font-weight: 400;
	line-height: 1.35;
	letter-spacing: .02em;
	text-align: center;
	color: var(--ha2d-pub-modal-fg);
}

.ha2d-pub-modal__title[hidden] {
	display: none;
}

.ha2d-pub-modal__images {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2.4rem;
/* 	max-width: 1560px; */
	width: 100%;
	margin: 0 auto;
}

.ha2d-pub-modal__figure {
	margin: 0;
	width: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1rem;
}

/* Portrait covers are capped by height, wide spreads fill the column. */
.ha2d-pub-modal__img {
	display: block;
/* 	width: auto; */
	height: auto;
	max-width: 100%;
/* 	max-height: 88vh; */
	background: rgba(255, 255, 255, .04);
}

.ha2d-pub-modal__caption {
	max-width: 70ch;
	font-size: 1.3rem;
	line-height: 1.5;
	text-align: center;
	opacity: .7;
}
.popup-button {
    width: 100%;
    background: #fff;
    display: flex;
    align-items: baseline;
    align-content: center;
}
.ha2d-pub-modal__publication {
    z-index: 9;
    padding: 10px 20px;
    position: absolute;
    top: 7px;
    left: 40px;
    font-size: 15px;
    background: #000;
    color: #fff;
    border-radius: 100px;
}
.ha2d-pub-modal__close {
    position: absolute;
    top: 0px;
    /* right: 30px; */
    z-index: 2;
	width: 100%;
    height: 50px;
    padding: 22px;
    border: 1px solid rgba(255, 255, 255, .3);
    /* border-radius: 50%; */
    background: #fff;
    color: #000;
    font-size: 40px;
    line-height: 1;
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease;
    display: flex;
    align-content: center;
    justify-content: flex-end;
    align-items: center;
}


/* Scroll lock on the page behind the popup. */
body.ha2d-pub-modal-open {
	overflow: hidden;
}

@media (max-width: 767px) {
	.ha2d-pub-modal__scroll {
		padding: 7rem 1.6rem 4rem;
	}

	.ha2d-pub-modal__images {
		gap: 1.6rem;
	}

	.ha2d-pub-modal__img {
		max-height: none;
		width: 100%;
	}

/* 	.ha2d-pub-modal__close {
		top: 1.2rem;
		right: 1.2rem;
		width: 4rem;
		height: 4rem;
	} */

	.ha2d-pub-badge {
		opacity: 1;
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ha2d-pub-modal,
	.ha2d-pub-badge {
		transition: none;
	}
}
