/* MW Documents front end. Kept small: it loads on every page. */

.mwd-busy { cursor: progress !important; opacity: .7; }

.mwd-btn {
	display: inline-flex; align-items: center; gap: .5em;
	padding: .7em 1.3em; border-radius: 2px;
	background: var(--mwd-accent, #008bc0); color: #fff !important;
	font-weight: 600; text-decoration: none !important; line-height: 1.2;
	transition: filter .15s ease;
}
.mwd-btn:hover { filter: brightness(.92); }
.mwd-btn::before {
	content: ""; width: 1em; height: 1.15em; flex: none;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 24'%3E%3Cpath d='M2 0h11l7 7v15a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2zm10 1.5V8h6.5L12 1.5zM4 13v2h12v-2H4zm0 4v2h8v-2H4z'/%3E%3C/svg%3E") center / contain no-repeat;
	        mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 24'%3E%3Cpath d='M2 0h11l7 7v15a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2zm10 1.5V8h6.5L12 1.5zM4 13v2h12v-2H4zm0 4v2h8v-2H4z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.mwd-missing { color: #b32d2e; font-size: 13px; }

/* Lightbox rules start "html body": the engine's own stylesheet loads after
   this one and would win a tie.

   A see-through scrim over the page, so it reads as an overlay.
   --mwd-scrim is the ink colour at 80%, set by the loader. */
html body .df-lightbox-wrapper .df-lightbox-bg {
	background: var(--mwd-scrim, rgba(12,38,55,.8)) !important;
	-webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px);
	animation: mwd-fade .2s ease-out;
}
@keyframes mwd-fade { from { opacity: 0; } }

/* Close: a solid round button with a drawn cross, not the faint icon glyph */
html body .df-lightbox-wrapper .df-lightbox-controls { position: absolute; top: 10px; right: 12px; width: auto; height: auto; z-index: 1000; }
html body .df-lightbox-wrapper .df-lightbox-close {
	float: none; display: block; width: 44px; height: 44px; padding: 0;
	border: 0; border-radius: 50%; background: #fff; opacity: 1; color: #111;
	box-shadow: 0 2px 10px rgba(0,0,0,.3); font-size: 0;
	transition: transform .15s ease, box-shadow .15s ease;
}
html body .df-lightbox-wrapper .df-lightbox-close:hover { background: #fff; color: #000; transform: scale(1.06); box-shadow: 0 3px 14px rgba(0,0,0,.4); }
html body .df-lightbox-wrapper .df-lightbox-close:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
html body .df-lightbox-wrapper .df-lightbox-close::before {
	content: ""; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px;
	background: #111; filter: none; /* not currentColor: the engine makes this glyph white */
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M2 2l14 14M16 2L2 16' stroke='%23000' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
	        mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M2 2l14 14M16 2L2 16' stroke='%23000' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Page arrows read on the dark scrim */
html body .df-lightbox-wrapper .df-ui-next, html body .df-lightbox-wrapper .df-ui-prev { color: #fff; opacity: .85; }
html body .df-lightbox-wrapper .df-ui-next:hover, html body .df-lightbox-wrapper .df-ui-prev:hover { opacity: 1; }

/* Caption bar over the lightbox */
.mwd-caption {
	position: absolute; top: 0; left: 0; right: 68px; z-index: 5;
	display: flex; align-items: center; gap: 12px;
	min-height: 64px; padding: 10px 20px; pointer-events: none; box-sizing: border-box;
	font: 600 16px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.25);
}
.mwd-caption__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mwd-caption__rev {
	flex: none; padding: 2px 8px; border-radius: 99px;
	background: rgba(255,255,255,.16); font-size: 12px; font-weight: 600;
}
.mwd-caption__dl {
	flex: none; margin-left: auto; pointer-events: auto;
	padding: 9px 16px; border-radius: 2px; text-shadow: none;
	background: #fff; color: #111 !important; font-size: 13px; text-decoration: none !important;
	transition: background .15s ease;
}
.mwd-caption__dl:hover { background: #e9e9e9; }
@media (max-width: 600px) {
	.mwd-caption { min-height: 56px; padding: 8px 14px; font-size: 14px; right: 60px; }
	.mwd-caption__rev { display: none; }
	html body .df-lightbox-wrapper .df-lightbox-controls { top: 8px; right: 10px; }
	html body .df-lightbox-wrapper .df-lightbox-close { width: 40px; height: 40px; }
}
/* Leave room for the caption above the book */
html body .df-lightbox-wrapper .df-container { top: 0; }
html body .df-lightbox-wrapper .df-app { padding-top: 0; }

/* [mw_docs] list */
.mwd-list__search {
	width: 100%; margin: 0 0 14px; padding: 12px 14px; font-size: 16px;
	border: 1px solid #dbe2e8; border-radius: 2px;
}
.mwd-list__items { list-style: none !important; margin: 0 !important; padding: 0 !important; display: grid; gap: 10px; }
.mwd-list--grid .mwd-list__items { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.mwd-item { display: flex; align-items: stretch; border: 1px solid #dbe2e8; background: #fff; padding: 0 !important; }
.mwd-item[hidden] { display: none; }
.mwd-item__main { flex: 1; display: flex; gap: 14px; align-items: center; padding: 14px 16px; color: inherit !important; text-decoration: none !important; min-width: 0; }
.mwd-item__main:hover .mwd-item__title { color: var(--mwd-accent, #008bc0); }
.mwd-item__icon {
	flex: none; width: 40px; height: 48px; display: grid; place-items: center;
	background: #0c2637; color: #fff; font: 700 11px/1 sans-serif; letter-spacing: .06em;
	clip-path: polygon(0 0, 70% 0, 100% 22%, 100% 100%, 0 100%);
}
.mwd-item__cover { flex: none; width: 40px; height: 52px; object-fit: cover; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.mwd-item__text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mwd-item__title { font-weight: 600; line-height: 1.3; transition: color .15s; }
.mwd-item__summary { font-size: .9em; opacity: .8; line-height: 1.4; }
.mwd-item__meta { font-size: .8em; opacity: .65; }
.mwd-item__dl { flex: none; display: grid; place-items: center; width: 52px; border-left: 1px solid #dbe2e8; color: #5a6470 !important; }
.mwd-item__dl:hover { background: #f3f7fa; color: #0c2637 !important; }
