/**
 * TechBBQ modal shell — overlay, panel, close control.
 *
 * Figma modalSpeaker (gradient omitted by design):
 * - 1440: node 6734:58876
 * - 1024: node 6674:43036
 * - 768:  node 6674:43125
 * - 360:  node 6674:42952
 */

.techbbq-modal {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 0;
	box-sizing: border-box;
}

.techbbq-modal--hidden {
	display: none;
	pointer-events: none;
}

.techbbq-modal__backdrop {
	position: absolute;
	inset: 0;
	background: var(--techbbq-bg-surface-glass);
	-webkit-backdrop-filter: blur(15px);
	backdrop-filter: blur(15px);
}

.techbbq-modal__dialog {
	position: relative;
	z-index: 1;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: none;
	max-height: 100vh;
	min-height: 100vh;
	overflow: hidden;
	border: 1px solid var(--techbbq-border-tertiary);
	border-top: 0;
	border-right: 0;
	border-left: 0;
	border-radius: 0;
	background: var(--techbbq-bg-main);
	color: var(--techbbq-content-primary);
}

.techbbq-modal__dialog--wide {
	max-width: none;
}

.techbbq-modal__body {
	position: relative;
	box-sizing: border-box;
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	min-height: 0;
	overflow: hidden;
	--techbbq-modal-padding: var(--techbbq-space-2);
	padding: var(--techbbq-modal-padding);
}

.techbbq-modal__header {
	display: none;
}

.techbbq-modal__body--with-title {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	grid-template-rows: auto minmax(0, 1fr);
	column-gap: var(--techbbq-space-2);
	row-gap: var(--techbbq-space-3);
}

.techbbq-modal__body--with-title .techbbq-modal__header {
	display: block;
	grid-column: 1;
	grid-row: 1;
	align-self: center;
	min-width: 0;
}

.techbbq-modal__body--with-title .techbbq-modal__close {
	position: static;
	grid-column: 2;
	grid-row: 1;
	align-self: start;
	z-index: auto;
}

.techbbq-modal__body--with-title .techbbq-modal__content {
	grid-column: 1 / -1;
	grid-row: 2;
	min-height: 0;
}

.techbbq-modal__title {
	margin: 0;
	color: var(--techbbq-content-primary);
}

.techbbq-modal__close {
	position: absolute;
	top: var(--techbbq-modal-padding);
	right: var(--techbbq-modal-padding);
	z-index: 2;
	display: flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: var(--techbbq-btn-height-large);
	height: var(--techbbq-btn-height-large);
	padding: 0;
	border: 1px solid transparent;
	border-radius: var(--techbbq-radius-pill);
	background-color: var(--techbbq-bg-surface-overlay);
	color: var(--techbbq-content-primary);
	cursor: pointer;
}

/* Beat Hello reset.css [type=button]:hover / button:hover (#c36). */
button.techbbq-modal__close:hover,
[type="button"].techbbq-modal__close:hover {
	background-color: var(--techbbq-color-grey-alpha-50-50);
	color: var(--techbbq-content-primary);
	border: 1px solid var(--techbbq-border-secondary);
}

button.techbbq-modal__close:focus,
[type="button"].techbbq-modal__close:focus {
	background-color: var(--techbbq-bg-surface-overlay);
	color: var(--techbbq-content-primary);
	border-color: transparent;
}

button.techbbq-modal__close:focus-visible,
[type="button"].techbbq-modal__close:focus-visible {
	background-color: var(--techbbq-color-grey-alpha-50-50);
	color: var(--techbbq-content-primary);
	border: 1px solid var(--techbbq-border-secondary);
	outline: 2px solid var(--techbbq-content-primary);
	outline-offset: 2px;
}

button.techbbq-modal__close:active,
[type="button"].techbbq-modal__close:active {
	background-color: var(--techbbq-color-grey-alpha-50-40);
	color: var(--techbbq-content-primary);
	border: 1px solid var(--techbbq-border-secondary);
}

.techbbq-modal__close-icon {
	display: block;
	width: 20px;
	height: 20px;
	-webkit-mask: url("../../images/icon-xmark-20.svg") center / contain no-repeat;
	mask: url("../../images/icon-xmark-20.svg") center / contain no-repeat;
	background-color: currentColor;
}

.techbbq-modal__content {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.techbbq-modal__content--pinned-header {
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.techbbq-modal__body--edge-scrollbar {
	padding-right: 0;
}

html.techbbq-modal-open,
body.techbbq-modal-open {
	overflow: hidden;
}

/* ── Tablet+ (768+) ───────────────────────────────────────────── */
@media (min-width: 768px) {
	.techbbq-modal {
		align-items: center;
		padding: var(--techbbq-space-3);
	}

	.techbbq-modal__dialog {
		max-width: var(--techbbq-modal-max-width, 560px);
		max-height: calc(100vh - (var(--techbbq-space-3) * 2));
		min-height: 0;
		border: 1px solid var(--techbbq-border-tertiary);
		border-radius: 12px;
	}

	.techbbq-modal__dialog--wide {
		max-width: var(--techbbq-modal-max-width-wide, 840px);
	}

	.techbbq-modal__body {
		--techbbq-modal-padding: var(--techbbq-space-3);
		padding: var(--techbbq-modal-padding);
	}
}
