/* Additions to the compiled theme CSS (super8.css is built from SCSS with an old toolchain). */

/*
 * Captions: WordPress >= 5 prints style="width: <image width>px" on .wp-caption (4.9 printed max-width),
 * so full-size images overflowed the viewport. Cap them at the container like before.
 */
.wp-caption {
	max-width: 100%;
}

.wp-caption img {
	max-width: 100%;
	height: auto;
}

/*
 * Theme My Login 7 renders <button class="tml-button"> instead of <input type="submit">; the theme only
 * styled the latter (as .pmpro_btn), so the login button fell back to the grey generic form button.
 */
.tml .tml-button {
	min-height: 44px;
	padding: 5px 15px;
	border: none !important;
	border-radius: 0 !important;
	background-color: black;
	color: white;
	font-family: "radikal-bold" !important;
	font-size: 14px;
	font-weight: normal !important;
	height: auto;
}

.tml .tml-button:hover {
	background-color: #666;
	color: white;
}

.tml .tml-button:focus-visible {
	outline: 3px solid #666;
	outline-offset: 2px;
}

/* Image lightbox (assets/scripts/super8.js, native <dialog>) — replaces Fancybox */

.s8-lightbox {
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	height: 100%;
	max-height: 100%;
	margin: 0;
	padding: 3.5rem 0.5rem 2.5rem;
	border: 0;
	background: transparent;
	color: #fff;
	overflow: hidden;
}

.s8-lightbox::backdrop {
	background: rgba(0, 0, 0, 0.9);
}

.s8-lightbox[open] {
	display: flex;
	align-items: center;
	justify-content: center;
}

.s8-lightbox__figure {
	display: flex;
	flex-direction: column;
	align-items: center;
	max-width: 100%;
	max-height: 100%;
	margin: 0;
}

.s8-lightbox__image {
	display: block;
	max-width: 100%;
	max-height: calc(100vh - 8rem);
	width: auto;
	height: auto;
	object-fit: contain;
	cursor: pointer;
}

.s8-lightbox__caption {
	margin-top: 0.5rem;
	max-width: 60ch;
	font-size: 0.875rem;
	line-height: 1.4;
	text-align: center;
}

.s8-lightbox__counter {
	position: absolute;
	top: 1rem;
	left: 1rem;
	margin: 0;
	font-size: 0.875rem;
}

.s8-lightbox__btn {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0;
	border: 0;
	border-radius: 2px;
	background: rgba(0, 0, 0, 0.6);
	color: #fff;
	font-size: 2rem;
	line-height: 1;
	cursor: pointer;
}

.s8-lightbox__btn:hover {
	background: rgba(0, 0, 0, 0.85);
}

.s8-lightbox__btn:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 2px;
}

.s8-lightbox__btn[hidden] {
	display: none;
}

.s8-lightbox__close {
	top: 0.5rem;
	right: 0.5rem;
}

.s8-lightbox__prev,
.s8-lightbox__next {
	bottom: 0.5rem;
}

.s8-lightbox__prev {
	left: 0.5rem;
}

.s8-lightbox__next {
	right: 0.5rem;
}

@media (min-width: 768px) {
	.s8-lightbox {
		padding: 3.5rem 4.5rem;
	}

	.s8-lightbox__prev,
	.s8-lightbox__next {
		top: 50%;
		bottom: auto;
		transform: translateY(-50%);
	}

	.s8-lightbox__prev {
		left: 1rem;
	}

	.s8-lightbox__next {
		right: 1rem;
	}

	.s8-lightbox__close {
		top: 1rem;
		right: 1rem;
	}
}

/* Visually hidden text for icon-only controls (play buttons) */
.s8-visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.video-control-play:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 2px;
}
