/* Copi Detail Modal — [copi_more] shortcode */

/* ---- Button (sits inside a table cell) ---- */
.copi-more__btn {
	display: inline-block;
	margin: 4px 0 0;
	padding: 2px 10px;
	border: 1px solid var(--color_main, #2b6cb0);
	border-radius: 999px;
	background: transparent;
	color: var(--color_main, #2b6cb0);
	font-size: 0.8em;
	line-height: 1.6;
	white-space: nowrap;
	cursor: pointer;
	vertical-align: middle;
}

.copi-more__btn:hover,
.copi-more__btn:focus-visible {
	background: var(--color_main, #2b6cb0);
	color: #fff;
}

/*
 * ---- Modal ----
 * The popover itself is a transparent full-screen layer in the browser's top
 * layer, so table overflow cannot clip it. The scrim button fills it and
 * closes the modal on an outside tap without letting the tap reach links
 * underneath. The card sits on top of the scrim.
 */
.copi-more__panel {
	box-sizing: border-box;
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	margin: 0;
	padding: 0;
	overflow: hidden;
	border: none;
	background: transparent;
	color: #333;
	/* Reset values inherited from table cells. */
	text-align: left;
	white-space: normal;
	word-break: normal;
	overflow-wrap: break-word;
	font-size: 15px;
	font-weight: normal;
	line-height: 1.75;
}

.copi-more__panel:popover-open {
	display: grid;
	place-items: center;
}

.copi-more__scrim {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	border: none;
	border-radius: 0;
	background: rgba(0, 0, 0, 0.45);
	cursor: default;
}

.copi-more__card {
	position: relative;
	z-index: 1;
	box-sizing: border-box;
	width: min(560px, calc(100vw - 32px));
	max-height: min(80vh, 640px);
	overflow: auto;
	border-radius: 10px;
	background: #fff;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.copi-more__head {
	position: sticky;
	top: 0;
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 14px 16px 10px 20px;
	background: #fff;
	border-bottom: 1px solid #eee;
}

.copi-more__title {
	flex: 1;
	margin: 0;
	font-weight: bold;
	font-size: 16px;
	line-height: 1.5;
}

.copi-more__close {
	flex: none;
	margin-left: auto;
	width: 32px;
	height: 32px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: #f2f2f2;
	color: #555;
	font-size: 20px;
	line-height: 32px;
	text-align: center;
	cursor: pointer;
}

.copi-more__close:hover,
.copi-more__close:focus-visible {
	background: #e2e2e2;
}

.copi-more__body {
	padding: 14px 20px 20px;
}

.copi-more__body > :first-child {
	margin-top: 0;
}

.copi-more__body > :last-child {
	margin-bottom: 0;
}

/* ---- Fallback: browsers without popover support show the text inline ---- */
@supports not selector(:popover-open) {
	.copi-more__btn,
	.copi-more__scrim,
	.copi-more__head {
		display: none;
	}

	.copi-more__panel {
		position: static;
		width: auto;
		height: auto;
		margin: 4px 0 0;
		overflow: visible;
		color: inherit;
		font-size: 0.9em;
	}

	.copi-more__card {
		width: auto;
		max-height: none;
		overflow: visible;
		background: transparent;
		box-shadow: none;
	}

	.copi-more__body {
		padding: 0;
	}
}
