/* Biblioteca Cosmoserr - stile allineato al box newsletter / candidature */
.cosmo-bib,
.cosmo-bib-modal,
.cosmo-bib-viewer {
	--cb-accent: #4886ff;
	--cb-accent-hover: #2f6fe8;
	--cb-border: #e0e0e0;
	--cb-text: #212121;
	font-family: "Poppins", Helvetica, Arial, sans-serif;
}
.cosmo-bib *,
.cosmo-bib-modal *,
.cosmo-bib-viewer * { box-sizing: border-box; }

html.cosmo-bib-lock,
html.cosmo-bib-lock body { overflow: hidden; }

/* ---------- riquadro nell'articolo ---------- */
.cosmo-bib {
	display: flex;
	align-items: center;
	gap: 18px;
	margin: 30px 0;
	padding: 22px 24px !important;
	border: 1px solid var(--cb-border);
	background: #fff;
}
.cosmo-bib__icon {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	background: #eef4ff;
	color: var(--cb-accent);
}
.cosmo-bib__body { flex: 1 1 auto; min-width: 0; }
.cosmo-bib .cosmo-bib__title,
.cosmo-bib-modal .cosmo-bib__title {
	margin: 0 0 4px;
	font-family: inherit;
	font-size: 14px;
	font-weight: 700 !important;
	line-height: 1.4;
	text-transform: uppercase;
	letter-spacing: .02em;
	color: var(--cb-text);
}
.cosmo-bib__title span { color: var(--cb-accent); }
.cosmo-bib__name {
	margin: 0 !important;
	font-size: 13px;
	line-height: 1.5;
	color: #6b6b6b;
}
.cosmo-bib__btn {
	flex: 0 0 auto;
	padding: 0 22px;
	height: 44px;
	border: 0;
	border-radius: 0;
	background: var(--cb-accent);
	color: #fff;
	font-family: inherit;
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .03em;
	cursor: pointer;
	transition: background .2s;
}
.cosmo-bib__btn:hover { background: var(--cb-accent-hover); }
.cosmo-bib__btn:disabled { opacity: .6; cursor: wait; }
.cosmo-bib__btn--full { width: 100%; }

@media (max-width: 600px) {
	.cosmo-bib { flex-wrap: wrap; padding: 18px !important; }
	.cosmo-bib__btn { width: 100%; }
}

/* ---------- popup email ---------- */
.cosmo-bib-modal {
	position: fixed;
	inset: 0;
	z-index: 2147483600; /* sopra la barra di WordPress e agli elementi del tema */
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(15, 25, 45, .65);
}
.cosmo-bib-modal[hidden] { display: none; }
.cosmo-bib-modal__box {
	position: relative;
	width: 100%;
	max-width: 460px;
	padding: 30px 28px 26px;
	background: #fff;
	box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
}
.cosmo-bib-modal__close {
	position: absolute;
	top: -14px;
	right: -14px;
	width: 34px;
	height: 34px;
	border: 0;
	border-radius: 50%;
	background: var(--cb-accent);
	color: #fff;
	font-size: 22px;
	line-height: 34px;
	cursor: pointer;
}
.cosmo-bib-modal .cosmo-bib__title {
	position: relative;
	margin-bottom: 14px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--cb-border);
}
.cosmo-bib-modal .cosmo-bib__title::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: -1px;
	width: 30px;
	height: 2px;
	background: var(--cb-accent);
}
.cosmo-bib-modal__intro { margin: 0 0 16px; font-size: 13px; line-height: 1.5; color: #6b6b6b; }
.cosmo-bib-form input[type="email"] {
	width: 100%;
	height: 42px;
	margin: 0 0 14px;
	padding: 0 14px;
	border: 1px solid var(--cb-border);
	border-radius: 0;
	font-family: inherit;
	font-size: 14px;
	color: var(--cb-text);
	box-shadow: none;
}
.cosmo-bib-form input[type="email"]:focus { outline: none; border-color: var(--cb-accent); }
.cosmo-bib-form__privacy {
	display: flex;
	gap: 8px;
	align-items: flex-start;
	margin: 0 0 16px;
	font-size: 13px;
	line-height: 1.5;
	color: #6b6b6b;
	cursor: pointer;
}
.cosmo-bib-form__privacy input { margin-top: 3px; accent-color: var(--cb-accent); }
.cosmo-bib-form__privacy a { color: var(--cb-accent); text-decoration: underline; }
.cosmo-bib-form__error { margin: 0 0 14px; padding: 8px 12px; border: 0; background: #fdf0f0; font-size: 13px; color: #a12626; }
.cosmo-bib-form__error[hidden] { display: none; }
.cosmo-bib-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---------- visualizzatore ---------- */
.cosmo-bib-viewer {
	position: fixed;
	inset: 0;
	z-index: 2147483601;
	display: flex;
	flex-direction: column;
	background: #1d2330;
	color: #fff;
}
.cosmo-bib-viewer[hidden] { display: none; }
.cosmo-bib-viewer__bar {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 16px;
	height: 56px;
	padding: 0 16px 0 20px;
	background: #141924;
}
.cosmo-bib-viewer__title {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	font-size: 14px;
	font-weight: 700;
}
.cosmo-bib-viewer__pages { flex: 0 0 auto; font-size: 13px; color: #b9c2d3; }
.cosmo-bib-viewer__close {
	flex: 0 0 auto;
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 50%;
	background: var(--cb-accent);
	color: #fff;
	font-size: 22px;
	line-height: 36px;
	cursor: pointer;
}
.cosmo-bib-viewer__stage {
	position: relative;
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 12px 70px;
	overflow: hidden;
}
.cosmo-bib-page { position: relative; background: #fff; overflow: hidden; }
/* ombra della piega centrale */
.cosmo-bib-page.--left::after,
.cosmo-bib-page.--right::after {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	width: 40px;
	pointer-events: none;
}
.cosmo-bib-page.--left::after { right: 0; background: linear-gradient(to left, rgba(0,0,0,.18), rgba(0,0,0,0)); }
.cosmo-bib-page.--right::after { left: 0; background: linear-gradient(to right, rgba(0,0,0,.18), rgba(0,0,0,0)); }
.cosmo-bib-page img { display: block; width: 100%; height: 100%; object-fit: contain; user-select: none; pointer-events: none; }
.cosmo-bib-viewer__book { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.cosmo-bib-viewer__loading {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	font-size: 14px;
	color: #b9c2d3;
}
.cosmo-bib-viewer__loading[hidden] { display: none; }
.cosmo-bib-viewer__spinner {
	width: 38px;
	height: 38px;
	border: 3px solid rgba(255, 255, 255, .2);
	border-top-color: var(--cb-accent);
	border-radius: 50%;
	animation: cosmo-bib-spin .8s linear infinite;
}
@keyframes cosmo-bib-spin { to { transform: rotate(360deg); } }
.cosmo-bib-viewer__nav {
	position: absolute;
	top: 50%;
	width: 46px;
	height: 46px;
	margin-top: 10px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .12);
	color: #fff;
	font-size: 30px;
	line-height: 44px;
	cursor: pointer;
	transition: background .2s;
}
.cosmo-bib-viewer__nav:hover { background: var(--cb-accent); }
.cosmo-bib-viewer__nav--prev { left: 14px; }
.cosmo-bib-viewer__nav--next { right: 14px; }

/* mentre il documento è aperto nasconde il pulsante flottante di iubenda,
   che altrimenti copre le frecce (le preferenze cookie restano raggiungibili
   appena si chiude il documento) */
html.cosmo-bib-lock .iubenda-tp-btn,
html.cosmo-bib-lock .iub__us-widget,
html.cosmo-bib-lock #iubenda-cs-floating-btn { display: none !important; }

@media (max-width: 767px) {
	.cosmo-bib-viewer__stage { padding: 8px 8px 74px; }
	/* frecce affiancate al centro, lontane dagli angoli dove i siti mettono i pulsanti flottanti */
	.cosmo-bib-viewer__nav { top: auto; bottom: 14px; margin: 0; background: rgba(0, 0, 0, .45); }
	.cosmo-bib-viewer__nav--prev { left: calc(50% - 56px); }
	.cosmo-bib-viewer__nav--next { right: auto; left: calc(50% + 10px); }
	.cosmo-bib-viewer__pages { display: none; }
}

/* campo "Mi occupo di" */
.cosmo-bib-form__label { display: block; margin: 0 0 6px; font-size: 13px; font-weight: 700; color: #212121; }
.cosmo-bib-form select {
	width: 100%;
	height: 42px;
	margin: 0 0 14px;
	padding: 0 12px;
	border: 1px solid var(--cb-border);
	border-radius: 0;
	background: #fff;
	font-family: inherit;
	font-size: 14px;
	color: var(--cb-text);
	box-shadow: none;
}
.cosmo-bib-form select:focus { outline: none; border-color: var(--cb-accent); }
