/* The "Advertise with us" slide-in (Bugpot X8CWBV). Printed hidden by inc/advertise-panel.php,
   shown by assets/js/advertise-panel.js. Fixed to the bottom-left so it never meets the Bugpot
   button or the Ask Axel button bottom-right, and clear of the quick-nav dock on desktop.
   It uses the page tokens, so it follows light and dark mode. */

.adv-panel {
	--adv-gap: 16px;
	position: fixed;
	z-index: 72; /* above the page, under the mobile menu (75/80), the newsletter, sign-in and search pop-ups */
	left: var(--adv-gap);
	bottom: calc(var(--adv-gap) + env(safe-area-inset-bottom, 0px));
	box-sizing: border-box;
	width: min(20rem, calc(100vw - 2 * var(--adv-gap)));
	max-height: calc(100vh - 2 * var(--adv-gap));
	overflow: auto;
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 0 .9rem;
	padding: 1.05rem 1.1rem 1.1rem;
	background: rgb(var(--sf-panel));
	color: rgb(var(--tx-ink));
	border: 1px solid rgb(var(--ln-ink) / .14);
	border-top: 3px solid var(--accent);
	border-radius: 4px;
	box-shadow: 0 14px 40px rgba(0, 0, 0, .22);
	font-family: Barlow, sans-serif;
	text-align: left;
	opacity: 0;
	transform: translateY(26px);
	transition: transform .34s cubic-bezier(.22, 1, .36, 1), opacity .3s ease, left .32s cubic-bezier(.22, 1, .36, 1);
}
.adv-panel[hidden] { display: none; }
.adv-panel.is-in { opacity: 1; transform: none; }
:root[data-theme="dark"] .adv-panel { box-shadow: 0 14px 40px rgba(0, 0, 0, .6); }

.adv-panel--photo { grid-template-columns: 4.5rem minmax(0, 1fr); align-items: start; }
.adv-panel__img { display: block; width: 4.5rem; height: 4.5rem; object-fit: cover; border-radius: 3px; background: rgb(var(--sf-tint)); }

.adv-panel__title {
	margin: 0;
	padding-right: 1.9rem; /* room for the close button */
	font: 700 1.2rem/1.04 Rajdhani, sans-serif;
	letter-spacing: .01em;
	text-transform: uppercase;
	text-wrap: balance;
	color: rgb(var(--tx-ink));
}
.adv-panel__text { margin: .45rem 0 0; font-size: .875rem; line-height: 1.45; color: rgb(var(--tx-body)); }
.adv-panel__btn { margin-top: .85rem; text-decoration: none; }
.adv-panel__btn:focus-visible, .adv-panel__close:focus-visible { outline: 2px solid rgb(var(--tx-ink)); outline-offset: 2px; }

.adv-panel__close {
	position: absolute;
	top: .3rem;
	right: .3rem;
	display: grid;
	place-items: center;
	width: 2.25rem;
	height: 2.25rem;
	padding: 0;
	border: 0;
	border-radius: 3px;
	background: transparent;
	color: rgb(var(--tx-mid));
	cursor: pointer;
	transition: background-color .15s, color .15s;
}
.adv-panel__close:hover { background: rgb(var(--sf-tint)); color: rgb(var(--tx-ink)); }

/* The quick-nav dock sits bottom-centre on the content column from 1100px up. Beside the sidebar,
   the panel starts where the content does; on narrower desktops, where the dock would run into it,
   it rides above the dock instead. */
@media (min-width: 1100px) {
	.adv-panel { left: calc(var(--sb-w) + 20px); }
}
@media (min-width: 1100px) and (max-width: 1439.98px) {
	.adv-panel { bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }
}

/* Phones: stay left of the Bugpot and Ask Axel buttons, which hold the right-hand 70px. */
@media (max-width: 479.98px) {
	.adv-panel { --adv-gap: 12px; right: 82px; width: auto; padding: .9rem .95rem 1rem; }
	.adv-panel__title { font-size: 1.1rem; }
	.adv-panel__text { font-size: .84rem; }
	.adv-panel__img { display: none; }
	.adv-panel--photo { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
	.adv-panel { transform: none; transition: opacity .15s linear; }
}

@media print { .adv-panel { display: none !important; } }
