/* ==========================================================================
   Question of the Week — right-edge slide-in drawer
   ========================================================================== */

.bgl-qotw {
	--qotw-ink: #001a1f;
	--qotw-teal: #003842;
	--qotw-accent: #428583;
	--qotw-accent-dark: #2f6362;
	--qotw-amber: #ea9921;
	--qotw-join-amber: #E9A84A;
	--qotw-paper: #ffffff;
	--qotw-muted: #5a6a6e;
	--qotw-border: rgba(0, 48, 56, 0.12);
	--qotw-radius: 16px;
	--qotw-z: 10500;
	font-family: 'Fustat', 'Manrope', sans-serif;
	color: var(--qotw-ink);
}

.bgl-qotw[hidden] {
	display: none !important;
}

.bgl-qotw-tab {
	position: fixed;
	top: 42%;
	right: 0;
	z-index: var(--qotw-z);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 14px 8px 14px 10px;
	border: 1px solid var(--qotw-border);
	border-right: 0;
	border-radius: 12px 0 0 12px;
	background: var(--qotw-paper);
	box-shadow: -6px 4px 20px rgba(0, 26, 31, 0.10);
	color: var(--qotw-teal);
	cursor: pointer;
	transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s ease, background 0.2s ease;
}

.bgl-qotw-tab:hover,
.bgl-qotw-tab:focus-visible {
	background: #f4f8f8;
	box-shadow: -8px 6px 24px rgba(0, 26, 31, 0.14);
	outline: none;
}

.bgl-qotw-tab-label {
	writing-mode: vertical-rl;
	transform: rotate(180deg);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	line-height: 1.2;
	white-space: nowrap;
}

.bgl-qotw-drawer {
	position: fixed;
	top: calc(var(--bgl-header-h, 96px) + 16px);
	right: 0;
	z-index: var(--qotw-z);
	width: min(400px, calc(100vw - 16px));
	max-height: calc(100vh - var(--bgl-header-h, 96px) - 32px);
	max-height: calc(100dvh - var(--bgl-header-h, 96px) - 32px);
	background: var(--qotw-paper);
	border: 1px solid var(--qotw-border);
	border-right: 0;
	border-radius: var(--qotw-radius) 0 0 var(--qotw-radius);
	box-shadow: -12px 8px 40px rgba(0, 26, 31, 0.14);
	transform: translateX(104%);
	transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.bgl-qotw-drawer.is-open {
	transform: translateX(0);
	pointer-events: auto;
}

.bgl-qotw-drawer:not(.is-open) {
	pointer-events: none;
}

.bgl-qotw-collapse {
	position: absolute;
	top: 18px;
	left: 10px;
	width: 32px;
	height: 32px;
	border: 1px solid var(--qotw-border);
	border-radius: 999px;
	background: #f7fafa;
	color: var(--qotw-teal);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.bgl-qotw-collapse:hover,
.bgl-qotw-collapse:focus-visible {
	background: #eef5f5;
	border-color: var(--qotw-accent);
	outline: none;
}

.bgl-qotw-collapse i {
	font-size: 18px;
	line-height: 1;
}

.bgl-qotw-inner {
	overflow: auto;
	padding: 16px 46px 16px 46px;
	-webkit-overflow-scrolling: touch;
}

.bgl-qotw-icon {
	display: flex;
	justify-content: center;
	align-items: center;
	margin: 2px 0 14px;
}

.bgl-qotw-icon-badge {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 68px;
	height: 68px;
	border-radius: 50%;
	background: linear-gradient(145deg, #f5d078 0%, #E9A84A 38%, #d68a1a 100%);
	box-shadow:
		0 10px 28px rgba(233, 168, 74, 0.38),
		0 3px 10px rgba(214, 138, 26, 0.22),
		inset 0 1px 0 rgba(255, 255, 255, 0.55),
		inset 0 -2px 8px rgba(180, 110, 10, 0.18);
	overflow: hidden;
}

.bgl-qotw-icon-badge::after {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background: linear-gradient(
		115deg,
		transparent 28%,
		rgba(255, 255, 255, 0.45) 50%,
		transparent 72%
	);
	background-size: 220% 100%;
	background-position: 130% 0;
	animation: bgl-qotw-shimmer 5s ease-in-out infinite;
	pointer-events: none;
}

.bgl-qotw-icon-badge > .ph-question {
	position: relative;
	z-index: 1;
	font-size: 34px;
	line-height: 1;
	color: #fff;
	text-shadow: 0 1px 3px rgba(120, 70, 0, 0.28);
}

@keyframes bgl-qotw-shimmer {
	0%, 72% {
		background-position: 130% 0;
		opacity: 0;
	}
	74% {
		opacity: 1;
	}
	86% {
		background-position: -30% 0;
		opacity: 1;
	}
	88%, 100% {
		background-position: -30% 0;
		opacity: 0;
	}
}

.bgl-qotw-kicker {
	margin: 0 0 8px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--qotw-accent);
}

.bgl-qotw-question {
	margin: 0 0 14px;
	font-family: 'Crimson Pro', Georgia, serif;
	font-size: 22px;
	font-weight: 500;
	line-height: 1.3;
	letter-spacing: -0.02em;
	color: var(--qotw-ink);
}

.bgl-qotw-options {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.bgl-qotw-option {
	display: block;
	width: 100%;
	text-align: left;
	margin: 0;
	padding: 12px 14px;
	border: 1px solid var(--qotw-border);
	border-radius: 12px;
	background: #fff;
	color: var(--qotw-ink);
	font-family: inherit;
	font-size: 14px;
	font-weight: 550;
	line-height: 1.35;
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.bgl-qotw-option:hover,
.bgl-qotw-option:focus-visible {
	border-color: var(--qotw-accent);
	background: #f4f8f8;
	box-shadow: 0 2px 8px rgba(0, 56, 66, 0.06);
	outline: none;
}

.bgl-qotw-option:disabled {
	cursor: wait;
	opacity: 0.7;
}

.bgl-qotw-other {
	display: none;
	margin-top: 4px;
	padding: 12px 0 0;
}

.bgl-qotw-panel.is-other-open .bgl-qotw-other {
	display: block !important;
}

.bgl-qotw-panel.is-other-open .bgl-qotw-options,
.bgl-qotw-panel.is-other-open .bgl-qotw-view,
.bgl-qotw-panel.is-other-open .bgl-qotw-anon {
	display: none !important;
}

.bgl-qotw-other-prompt {
	margin: 0 0 10px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.35;
	color: var(--qotw-ink);
}

.bgl-qotw-other-input {
	display: block;
	width: 100%;
	margin: 0 0 10px;
	padding: 11px 12px;
	border: 1px solid var(--qotw-border);
	border-radius: 12px;
	background: #fff;
	color: var(--qotw-ink);
	font-family: inherit;
	font-size: 14px;
	line-height: 1.35;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.bgl-qotw-other-input:focus {
	outline: none;
	border-color: var(--qotw-accent);
	box-shadow: 0 0 0 3px rgba(66, 133, 131, 0.14);
}

.bgl-qotw-other-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

.bgl-qotw-other-submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 10px 18px;
	border: 0;
	border-radius: 999px;
	background: #428583;
	color: #fff;
	font-family: inherit;
	font-size: 14px;
	font-weight: 650;
	cursor: pointer;
	transition: background 0.15s ease;
}

.bgl-qotw-other-submit:hover:not(:disabled),
.bgl-qotw-other-submit:focus-visible {
	background: #357170;
	outline: none;
}

.bgl-qotw-other-submit:disabled {
	opacity: 0.7;
	cursor: wait;
}

.bgl-qotw-other-back {
	padding: 0;
	border: 0;
	background: none;
	color: var(--qotw-muted);
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.bgl-qotw-other-back:hover,
.bgl-qotw-other-back:focus-visible {
	color: var(--qotw-ink);
	outline: none;
}

.bgl-qotw-view {
	display: inline-block;
	margin: 10px 0 0;
	padding: 0;
	border: 0;
	background: none;
	color: var(--qotw-accent);
	font-family: inherit;
	font-size: 13px;
	font-weight: 650;
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.bgl-qotw-view:hover,
.bgl-qotw-view:focus-visible {
	color: var(--qotw-accent-dark);
	outline: none;
}

.bgl-qotw-anon {
	margin: 8px 0 0;
	font-size: 12px;
	line-height: 1.4;
	color: var(--qotw-muted);
}

.bgl-qotw-role-prompt {
	margin: 0 0 12px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.35;
	color: var(--qotw-ink);
}

.bgl-qotw-role-label {
	display: block;
	margin: 0 0 6px;
	font-size: 12px;
	font-weight: 650;
	color: var(--qotw-muted);
}

.bgl-qotw-role-select {
	display: block;
	width: 100%;
	margin: 0 0 10px;
	padding: 11px 12px;
	border: 1px solid var(--qotw-border);
	border-radius: 12px;
	background: #fff;
	color: var(--qotw-ink);
	font-family: inherit;
	font-size: 14px;
	line-height: 1.35;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.bgl-qotw-role-select:focus {
	outline: none;
	border-color: var(--qotw-accent);
	box-shadow: 0 0 0 3px rgba(66, 133, 131, 0.14);
}

.bgl-qotw-role-other {
	margin: 0 0 10px;
}

.bgl-qotw-role-other-input {
	display: block;
	width: 100%;
	margin: 0;
	padding: 11px 12px;
	border: 1px solid var(--qotw-border);
	border-radius: 12px;
	background: #fff;
	color: var(--qotw-ink);
	font-family: inherit;
	font-size: 14px;
	line-height: 1.35;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.bgl-qotw-role-other-input:focus {
	outline: none;
	border-color: var(--qotw-accent);
	box-shadow: 0 0 0 3px rgba(66, 133, 131, 0.14);
}

.bgl-qotw-role-submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin: 0 0 8px;
	padding: 10px 18px;
	border: 0;
	border-radius: 999px;
	background: #428583;
	color: #fff;
	font-family: inherit;
	font-size: 14px;
	font-weight: 650;
	cursor: pointer;
	transition: background 0.15s ease;
}

.bgl-qotw-role-submit:hover:not(:disabled),
.bgl-qotw-role-submit:focus-visible {
	background: #357170;
	outline: none;
}

.bgl-qotw-role-submit:disabled {
	opacity: 0.7;
	cursor: wait;
}

.bgl-qotw-results {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.bgl-qotw-result {
	border: 1px solid var(--qotw-border);
	border-radius: 12px;
	padding: 10px 12px 12px;
	background: #fff;
}

.bgl-qotw-result.is-mine {
	border-color: rgba(66, 133, 131, 0.45);
	background: #f4f9f8;
}

.bgl-qotw-result-top {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 8px;
}

.bgl-qotw-result-text {
	font-size: 14px;
	font-weight: 600;
	line-height: 1.35;
	color: var(--qotw-ink);
}

.bgl-qotw-result-meta {
	flex-shrink: 0;
	font-size: 12px;
	font-weight: 650;
	color: var(--qotw-teal);
	white-space: nowrap;
}

.bgl-qotw-result-bar {
	height: 6px;
	border-radius: 999px;
	background: rgba(0, 56, 66, 0.08);
	overflow: hidden;
}

.bgl-qotw-result-fill {
	display: block;
	height: 100%;
	width: 0;
	border-radius: inherit;
	background: var(--qotw-accent);
	transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.bgl-qotw-yours {
	display: inline-block;
	margin-top: 6px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.02em;
	color: var(--qotw-amber);
}

.bgl-qotw.is-open .bgl-qotw-tab {
	opacity: 0;
	pointer-events: none;
	transform: translateX(8px);
}

@media (max-width: 640px) {
	.bgl-qotw-drawer {
		top: 12px;
		max-height: calc(100vh - 24px);
		max-height: calc(100dvh - 24px);
		width: min(100vw - 12px, 400px);
	}

	.bgl-qotw-inner {
		padding: 14px 42px 14px 42px;
	}

	.bgl-qotw-icon-badge {
		width: 60px;
		height: 60px;
	}

	.bgl-qotw-icon-badge > .ph-question {
		font-size: 30px;
	}

	.bgl-qotw-question {
		font-size: 20px;
	}

	.bgl-qotw-tab {
		top: 38%;
		padding: 12px 6px 12px 8px;
	}

	.bgl-qotw-tab-label {
		font-size: 11px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.bgl-qotw-tab,
	.bgl-qotw-drawer,
	.bgl-qotw-result-fill,
	.bgl-qotw-icon-badge::after {
		transition: none;
		animation: none;
	}
}

@media print {
	.bgl-qotw {
		display: none !important;
	}
}
