/* =============================================================================
   BrikPanel - bottom sheets for phones (front-end/shared/brikpanel-sheet.js)
   and the page transition between the screens that load them.

   Look: the BrikPanel admin language (white card, #303030 text, #e3e3e3 lines),
   rounded only at the top, a grip to drag it down. Motion: .38s to open, .28s
   to close, cubic-bezier(.4,0,.2,1), transform and opacity only.
   Stacking: scrim 100004, sheet 100005 (see the script's header).
   ============================================================================= */

/* The document scrolls under the top bar: the lock goes on <html>. */
html.brikpanel-sheet-lock {
	overflow: hidden !important;
}

.brikpanel-sheet-scrim {
	position: fixed;
	inset: 0;
	z-index: 100004;
	background: rgba(20, 20, 20, 0.38);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.28s;
	-webkit-tap-highlight-color: transparent;
}

.brikpanel-sheet-scrim.is-sheet-open {
	opacity: 1;
	visibility: visible;
	transition: opacity 0.38s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s;
}

/* ------------------------------------------------------------- the sheet */
.brikpanel-sheet {
	position: fixed;
	inset: auto 0 var(--bp-sheet-kb, 0px) 0;
	z-index: 100005;
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	max-height: calc(92vh - var(--bp-sheet-kb, 0px));
	max-height: calc(92dvh - var(--bp-sheet-kb, 0px));
	margin: 0 auto;
	padding-bottom: env(safe-area-inset-bottom, 0px);
	color: #303030;
	font-size: 14px;
	line-height: 1.45;
	background: #fff;
	border-radius: 18px 18px 0 0;
	box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.18);
	outline: 0;
	transform: translateY(calc(100% + 24px));
	visibility: hidden;
	transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.28s;
	-webkit-tap-highlight-color: transparent;
}

.brikpanel-sheet.is-sheet-open {
	transform: none;
	visibility: visible;
	transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s;
}

.brikpanel-sheet.is-sheet-open.is-sheet-dragging {
	transform: translateY(var(--bp-sheet-drag, 0px));
	transition: none;
}

.brikpanel-sheet.is-tall {
	height: calc(92vh - var(--bp-sheet-kb, 0px));
	height: calc(92dvh - var(--bp-sheet-kb, 0px));
}

/* Wider than a phone (a screen that asks for a sheet anyway): a card in the
   middle of the bottom edge rather than a bar across a desktop. */
@media (min-width: 783px) {
	.brikpanel-sheet {
		max-width: 560px;
	}
}

.brikpanel-sheet__grip {
	display: grid;
	flex: none;
	place-items: center;
	height: 22px;
	cursor: grab;
	touch-action: none;
}

.brikpanel-sheet__grip-bar {
	display: block;
	width: 38px;
	height: 5px;
	background: #d4d4d4;
	border-radius: 3px;
}

.brikpanel-sheet__head {
	display: flex;
	flex: none;
	align-items: center;
	gap: 10px;
	padding: 0 10px 10px 18px;
	touch-action: none;
}

.brikpanel-sheet__head.is-untitled {
	display: none;
}

.brikpanel-sheet__title {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
	color: #303030;
	font-size: 17px;
	font-weight: 650;
	line-height: 1.3;
}

.brikpanel-sheet__head-end {
	display: flex;
	flex: none;
	align-items: center;
	gap: 4px;
}

.brikpanel-sheet__close {
	display: grid;
	flex: none;
	place-items: center;
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	color: #303030;
	background: transparent;
	border: 0;
	border-radius: 10px;
	cursor: pointer;
}

.brikpanel-sheet__close:hover,
.brikpanel-sheet__close:active {
	background: #f1f1f1;
}

.brikpanel-sheet__close:focus-visible,
.brikpanel-sheet__action:focus-visible {
	outline: 2px solid #303030;
	outline-offset: -2px;
}

.brikpanel-sheet__body {
	flex: 1 1 auto;
	min-height: 0;
	padding: 4px 18px 18px;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
}

.brikpanel-sheet__foot {
	display: grid;
	flex: none;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 10px;
	padding: 12px 14px 14px;
	background: #fff;
	border-top: 1px solid #e3e3e3;
}

.brikpanel-sheet__foot.is-single {
	grid-template-columns: minmax(0, 1fr);
}

.brikpanel-sheet__foot.is-empty {
	display: none;
}

/* Thumb-zone buttons: a little taller than the 40px controls in the page. */
.brikpanel-sheet__btn,
.brikpanel-sheet__cancel {
	width: 100%;
	min-height: 46px;
	font-size: 15px;
	border-radius: 12px;
}

.brikpanel-sheet__text {
	margin: 0;
	color: #616161;
	font-size: 15px;
}

/* ------------------------------------------------------------ action list */
.brikpanel-sheet--actions .brikpanel-sheet__body {
	padding: 0 10px 10px;
}

.brikpanel-sheet__actions {
	display: flex;
	flex-direction: column;
}

.brikpanel-sheet__context {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
	margin: 0 0 6px;
	padding: 4px 8px 12px;
	border-bottom: 1px solid #e3e3e3;
}

.brikpanel-sheet__context-img {
	flex: none;
	width: 44px;
	height: 44px;
	object-fit: cover;
	border: 1px solid #e3e3e3;
	border-radius: 9px;
}

.brikpanel-sheet__context-text {
	display: grid;
	min-width: 0;
}

.brikpanel-sheet__context-title {
	overflow: hidden;
	color: #303030;
	font-size: 15px;
	font-weight: 600;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.brikpanel-sheet__context-sub {
	overflow: hidden;
	color: #616161;
	font-size: 13px;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.brikpanel-sheet__action {
	display: flex;
	align-items: center;
	gap: 14px;
	width: 100%;
	min-height: 52px;
	margin: 0;
	padding: 0 10px;
	color: #303030;
	font-family: inherit;
	font-size: 16px;
	font-weight: 500;
	text-align: start;
	background: transparent;
	border: 0;
	border-radius: 12px;
	cursor: pointer;
}

.brikpanel-sheet__action:hover,
.brikpanel-sheet__action:active {
	background: #f7f7f7;
}

.brikpanel-sheet__action:disabled {
	opacity: 0.45;
	cursor: default;
}

.brikpanel-sheet__action.is-danger {
	color: #d72c0d;
}

.brikpanel-sheet__icon {
	display: grid;
	flex: none;
	place-items: center;
	width: 22px;
	height: 22px;
	color: #616161;
}

.brikpanel-sheet__action.is-danger .brikpanel-sheet__icon {
	color: #d72c0d;
}

.brikpanel-sheet__icon svg {
	width: 20px;
	height: 20px;
}

.brikpanel-sheet__action-label {
	flex: 1 1 auto;
	min-width: 0;
}

.brikpanel-sheet__action-end {
	flex: none;
	color: #616161;
	font-size: 14px;
}

.brikpanel-sheet__sep {
	height: 1px;
	margin: 6px 10px;
	background: #e3e3e3;
}

.brikpanel-sheet__cancel {
	margin-top: 6px;
}

/* ------------------------------------------- an element made into a sheet */
/* The screen draws the look (its own stylesheet); this keeps an open one
   above the scrim. The grip only shows on a phone, where it is a sheet. */
.brikpanel-sheet-attached.is-sheet-open {
	z-index: 100005;
}

.brikpanel-sheet-attached > .brikpanel-sheet__grip {
	display: none;
}

@media (max-width: 782px) {
	.brikpanel-sheet-attached > .brikpanel-sheet__grip {
		display: grid;
	}
}

@media (prefers-reduced-motion: reduce) {
	.brikpanel-sheet,
	.brikpanel-sheet.is-sheet-open,
	.brikpanel-sheet-scrim,
	.brikpanel-sheet-scrim.is-sheet-open {
		transition-duration: 0.01ms;
	}
}

/* =============================================================================
   Page transition on phones (Chrome, Safari 18.2+; others simply load).
   WordPress 7 already opts every admin page in with a cross-fade; on the
   screens that load this file a phone gets the native-app slide instead: the
   new page comes in from the inline end, going back it slides the other way
   (the direction is set on <html data-bp-vt> by the inline script printed
   with this part). The BrikPanel top bar stays where it is.
   ============================================================================= */
@media (max-width: 782px) and (prefers-reduced-motion: no-preference) {
	@view-transition {
		navigation: auto;
	}

	#brikpanel-topbar {
		view-transition-name: bp-topbar;
	}

	::view-transition-group(bp-topbar) {
		animation: none;
	}

	::view-transition-old(root) {
		animation: 0.38s cubic-bezier(0.4, 0, 0.2, 1) both bp-vt-out;
	}

	::view-transition-new(root) {
		animation: 0.38s cubic-bezier(0.4, 0, 0.2, 1) both bp-vt-in;
	}

	html[data-bp-vt="back"]::view-transition-old(root) {
		z-index: 1;
		animation-name: bp-vt-out-back;
	}

	html[data-bp-vt="back"]::view-transition-new(root) {
		animation-name: bp-vt-in-back;
	}

	html[dir="rtl"]::view-transition-old(root) {
		animation-name: bp-vt-out-rtl;
	}

	html[dir="rtl"]::view-transition-new(root) {
		animation-name: bp-vt-in-rtl;
	}

	html[dir="rtl"][data-bp-vt="back"]::view-transition-old(root) {
		animation-name: bp-vt-out-back-rtl;
	}

	html[dir="rtl"][data-bp-vt="back"]::view-transition-new(root) {
		animation-name: bp-vt-in-back-rtl;
	}
}

@keyframes bp-vt-in {
	from { transform: translateX(100%); }
}

@keyframes bp-vt-out {
	to { transform: translateX(-26%); opacity: 0.6; }
}

@keyframes bp-vt-in-back {
	from { transform: translateX(-26%); opacity: 0.6; }
}

@keyframes bp-vt-out-back {
	to { transform: translateX(100%); }
}

@keyframes bp-vt-in-rtl {
	from { transform: translateX(-100%); }
}

@keyframes bp-vt-out-rtl {
	to { transform: translateX(26%); opacity: 0.6; }
}

@keyframes bp-vt-in-back-rtl {
	from { transform: translateX(26%); opacity: 0.6; }
}

@keyframes bp-vt-out-back-rtl {
	to { transform: translateX(-100%); }
}
