/* Fictioneer Announcement Bar. Uses the theme's colour variables so light and dark mode just work. */

.fcab-bar,
.fcab-modal {
	--fcab-color: var(--fcab-accent, var(--red-500, #dc2626));
}

/* ---- The strip ---------------------------------------------------------- */

.fcab-bar {
	position: relative;
	z-index: 5;
	width: 100%;
	background: rgba(220, 38, 38, .07);
	border-bottom: 1px solid rgba(127, 127, 127, .35);
	font-family: var(--ff-base, inherit);
	font-size: .9rem;
	line-height: 1.3;
}

@supports (background: color-mix(in srgb, red 10%, white)) {
	.fcab-bar {
		background: color-mix(in srgb, var(--fcab-color) 9%, var(--page-bg-color, var(--site-bg-color, #fff)));
		border-bottom-color: color-mix(in srgb, var(--fcab-color) 22%, rgba(127, 127, 127, .45));
	}
}

.fcab-bar__inner {
	appearance: none;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	width: 100%;
	max-width: var(--site-width, 960px);
	margin: 0 auto;
	padding: .7rem 1rem;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	color: var(--fg-600, #374151);
	font: inherit;
	text-align: left;
	text-shadow: none;
	cursor: pointer;
	box-sizing: border-box;
}

.fcab-bar__inner:focus-visible {
	outline: 2px solid var(--fcab-color);
	outline-offset: -2px;
}

.fcab-bar__text {
	display: flex;
	align-items: center;
	gap: .55rem;
	min-width: 0;
	flex: 1 1 auto;
}

.fcab-bar__icon {
	display: inline-flex;
	flex: 0 0 auto;
	color: var(--fcab-color);
}

.fcab-bar__icon .fcab-icon {
	width: 1.25rem;
	height: 1.25rem;
}

.fcab-bar__label {
	flex: 0 0 auto;
	color: var(--fg-900, #6b7280);
	white-space: nowrap;
}

.fcab-bar__title {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-weight: 600;
	color: var(--fg-500, var(--fg-600, #111827));
}

.fcab-bar__more {
	display: inline-flex;
	align-items: center;
	flex: 0 0 auto;
	gap: .15rem;
	font-weight: 500;
	white-space: nowrap;
	color: var(--fg-500, var(--fg-600, #111827));
}

.fcab-bar__more .fcab-icon {
	width: 1rem;
	height: 1rem;
	transition: transform .15s ease;
}

.fcab-bar__inner:hover .fcab-bar__more .fcab-icon {
	transform: translateX(2px);
}

.fcab-bar__inner:hover .fcab-bar__title {
	text-decoration: underline;
	text-underline-offset: 3px;
}

@media (max-width: 600px) {
	.fcab-bar { font-size: .85rem; }
	.fcab-bar__label { display: none; }
	.fcab-bar__inner { padding: .6rem .85rem; gap: .6rem; }
}

/* ---- The popup ---------------------------------------------------------- */

html.fcab-lock {
	overflow: hidden;
	padding-right: var(--fcab-scrollbar, 0);
}

.fcab-modal {
	position: fixed;
	inset: 0;
	z-index: 100050;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	box-sizing: border-box;
	opacity: 0;
	transition: opacity .18s ease;
	font-family: var(--ff-base, inherit);
}

.fcab-modal[hidden] { display: none; }
.fcab-modal.is-open { opacity: 1; }

.fcab-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .55);
	-webkit-backdrop-filter: blur(2px);
	backdrop-filter: blur(2px);
}

.fcab-modal__dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 770px;
	max-height: min(88vh, 760px);
	padding: 1.5rem 1.5rem 1.25rem 1.75rem;
	box-sizing: border-box;
	background: var(--modal-bg-color, var(--bg-50, #fff));
	color: var(--fg-600, #374151);
	border-radius: 14px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
	transform: translateY(8px) scale(.985);
	transition: transform .18s ease;
	outline: none;
}

.fcab-modal.is-open .fcab-modal__dialog { transform: none; }

.fcab-modal__close {
	appearance: none;
	position: absolute;
	top: 1rem;
	right: 1rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: 8px;
	color: var(--fg-500, var(--fg-600, #111827));
	cursor: pointer;
	box-shadow: none;
}

.fcab-modal__close:hover { background: rgba(127, 127, 127, .18); }
.fcab-modal__close:focus-visible { outline: 2px solid var(--fcab-color); outline-offset: 1px; }
.fcab-modal__close .fcab-icon { width: 1.5rem; height: 1.5rem; }

.fcab-modal__title {
	margin: 0 3rem .5rem 0;
	padding: 0;
	font-family: var(--ff-heading, inherit);
	font-size: 1.3rem;
	font-weight: 700;
	line-height: 1.3;
	color: var(--fg-500, var(--fg-600, #111827));
	border: 0;
	text-shadow: none;
}

.fcab-modal__date {
	display: flex;
	align-items: center;
	gap: .5rem;
	margin: 0 0 1rem;
	padding: 0 0 1rem;
	border-bottom: 1px dashed rgba(127, 127, 127, .45);
	font-size: .9rem;
	color: var(--fg-900, #6b7280);
}

.fcab-modal__date .fcab-icon { width: 1rem; height: 1rem; }

.fcab-modal__title:last-child,
.fcab-modal__title + .fcab-modal__scroll { margin-top: 0; }

.fcab-modal__scroll {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding-right: 1.25rem;
	scrollbar-width: thin;
	scrollbar-color: var(--fcab-color) rgba(127, 127, 127, .18);
	outline: none;
}

.fcab-modal__scroll::-webkit-scrollbar { width: 6px; }
.fcab-modal__scroll::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
.fcab-modal__scroll::-webkit-scrollbar-track { background: rgba(127, 127, 127, .18); border-radius: 3px; }
.fcab-modal__scroll::-webkit-scrollbar-thumb { background: var(--fcab-color); border-radius: 3px; }

.fcab-modal__body {
	font-size: 1rem;
	line-height: 1.65;
	color: var(--fg-600, #374151);
	overflow-wrap: anywhere;
}

.fcab-modal__body > *:first-child { margin-top: 0; }
.fcab-modal__body > *:last-child { margin-bottom: 0; }

.fcab-modal__body p { margin: 0 0 .9rem; }

/* The first paragraph is the summary: a little larger and softer. */
.fcab-modal__body > p:first-child {
	font-size: 1.12rem;
	line-height: 1.6;
	color: var(--fg-900, #6b7280);
}

.fcab-modal__body h2,
.fcab-modal__body h3,
.fcab-modal__body h4 {
	margin: 1.5rem 0 .6rem;
	padding: 0;
	font-family: var(--ff-heading, inherit);
	font-weight: 600;
	line-height: 1.3;
	color: var(--fg-900, #6b7280);
	border: 0;
	text-shadow: none;
}

.fcab-modal__body h2 { font-size: 1.5rem; }
.fcab-modal__body h3 { font-size: 1.35rem; }
.fcab-modal__body h4 { font-size: 1.15rem; }

.fcab-modal__body ul,
.fcab-modal__body ol { margin: 0 0 1rem; padding-left: 1.4rem; }
.fcab-modal__body ul { list-style: disc; }
.fcab-modal__body ol { list-style: decimal; }
.fcab-modal__body li { margin: 0 0 .45rem; padding: 0; }
.fcab-modal__body li::marker { color: var(--fg-900, #6b7280); }

.fcab-modal__body a { color: var(--fcab-color); text-decoration: underline; text-underline-offset: 2px; }
.fcab-modal__body img,
.fcab-modal__body video,
.fcab-modal__body iframe { max-width: 100%; height: auto; border-radius: 8px; }
.fcab-modal__body hr { border: 0; border-top: 1px dashed rgba(127, 127, 127, .45); margin: 1.25rem 0; }
.fcab-modal__body blockquote { margin: 0 0 1rem; padding: .25rem 0 .25rem 1rem; border-left: 3px solid var(--fcab-color); color: var(--fg-900, #6b7280); }

@media (max-width: 600px) {
	.fcab-modal { padding: .5rem; }
	.fcab-modal__dialog { padding: 1.1rem 1rem 1rem 1.1rem; max-height: 92vh; border-radius: 12px; }
	.fcab-modal__scroll { padding-right: .85rem; }
	.fcab-modal__title { font-size: 1.15rem; }
}

@media (prefers-reduced-motion: reduce) {
	.fcab-modal,
	.fcab-modal__dialog,
	.fcab-bar__more .fcab-icon { transition: none; }
}
