/**
 * Kiosque — paywall.
 *
 * Aucune police n'est imposée : le bloc hérite de la typographie du journal,
 * condition indispensable pour qu'il s'intègre à n'importe quel thème.
 * Seuls la couleur d'accent (--nkpw-accent, réglable dans l'admin), les
 * espacements et la structure sont pris en charge ici.
 */

.nkpw {
	--nkpw-accent: #146B5E;
	--nkpw-ink: #14181c;
	--nkpw-muted: #5b6670;
	--nkpw-line: #e3e6e8;
	--nkpw-surface: #ffffff;
	--nkpw-tint: #f5f7f7;

	box-sizing: border-box;
	margin: 0 0 2rem;
	padding: 1.75rem 1.5rem 1.5rem;
	border: 1px solid var(--nkpw-line);
	border-top: 3px solid var(--nkpw-accent);
	border-radius: 6px;
	background: var(--nkpw-surface);
	color: var(--nkpw-ink);
	line-height: 1.5;
}

.nkpw *,
.nkpw *::before,
.nkpw *::after {
	box-sizing: border-box;
}

/* Le fondu : le lecteur voit littéralement le texte lui échapper. */
.nkpw-teaser--faded {
	position: relative;
}

.nkpw-teaser--faded::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 9em;
	pointer-events: none;
	background: linear-gradient( to bottom, rgba( 255, 255, 255, 0 ) 0%, rgba( 255, 255, 255, .75 ) 55%, rgba( 255, 255, 255, 1 ) 100% );
}

.nkpw__head {
	margin-bottom: 1.5rem;
}

.nkpw__eyebrow {
	margin: 0 0 .5rem;
	font-size: .72em;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--nkpw-accent);
}

.nkpw__title {
	margin: 0 0 .5rem;
	font-size: 1.5em;
	line-height: 1.25;
}

.nkpw__text {
	margin: 0;
	color: var(--nkpw-muted);
	font-size: .95em;
}

/* Formules */

.nkpw__plans {
	display: grid;
	grid-template-columns: repeat( auto-fit, minmax( 190px, 1fr ) );
	gap: .875rem;
	margin: 0 0 1.25rem;
	padding: 0;
	list-style: none;
}

.nkpw__plan {
	position: relative;
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 1.25rem 1rem 1rem;
	border: 1px solid var(--nkpw-line);
	border-radius: 5px;
	background: var(--nkpw-tint);
	text-align: center;
}

.nkpw__plan--featured {
	border-color: var(--nkpw-accent);
	background: var(--nkpw-surface);
	box-shadow: 0 0 0 1px var(--nkpw-accent);
}

.nkpw__plan-badge {
	position: absolute;
	top: -.6em;
	left: 50%;
	transform: translateX( -50% );
	padding: .2em .7em;
	border-radius: 999px;
	background: var(--nkpw-accent);
	color: #fff;
	font-size: .68em;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
	white-space: nowrap;
}

.nkpw__plan-name {
	margin: 0 0 .5rem;
	font-size: .95em;
	font-weight: 600;
}

.nkpw__plan-price {
	margin: 0;
	line-height: 1;
}

.nkpw__plan-amount {
	font-size: 2em;
	font-weight: 700;
	letter-spacing: -.02em;
}

.nkpw__plan-currency {
	margin-left: .2em;
	font-size: .8em;
	font-weight: 600;
	color: var(--nkpw-muted);
}

.nkpw__plan-duration {
	margin: .4rem 0 0;
	font-size: .85em;
	color: var(--nkpw-muted);
}

/* Le coût par jour : ce qui rend les formules réellement comparables. */
.nkpw__plan-perday {
	margin: .15rem 0 0;
	font-size: .78em;
	font-weight: 600;
	color: var(--nkpw-accent);
}

.nkpw__plan-desc {
	margin: .6rem 0 0;
	font-size: .82em;
	color: var(--nkpw-muted);
}

.nkpw__choose {
	margin-top: auto;
	padding-top: .9rem;
}

.nkpw__choose,
.nkpw__pay {
	display: block;
	width: 100%;
	margin-top: .9rem;
	padding: .75rem 1rem;
	border: 1px solid var(--nkpw-accent);
	border-radius: 4px;
	background: transparent;
	color: var(--nkpw-accent);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	transition: background-color .15s ease, color .15s ease;
}

.nkpw__choose:hover,
.nkpw__choose:focus-visible,
.nkpw__choose[aria-pressed="true"] {
	background: var(--nkpw-accent);
	color: #fff;
}

.nkpw__pay {
	background: var(--nkpw-accent);
	color: #fff;
	font-size: 1.02em;
	padding: .85rem 1rem;
}

.nkpw__pay:hover,
.nkpw__pay:focus-visible {
	filter: brightness( 1.12 );
}

.nkpw__choose:disabled,
.nkpw__pay:disabled {
	opacity: .55;
	cursor: progress;
}

.nkpw :focus-visible {
	outline: 2px solid var(--nkpw-accent);
	outline-offset: 2px;
}

/* Formulaire */

.nkpw__form {
	padding: 1.15rem 1rem;
	border: 1px solid var(--nkpw-line);
	border-radius: 5px;
	background: var(--nkpw-tint);
}

.nkpw__form[hidden] {
	display: none;
}

.nkpw__form-title {
	margin: 0 0 .9rem;
	font-size: .9em;
	color: var(--nkpw-muted);
}

.nkpw__field {
	display: block;
	margin-bottom: .8rem;
}

.nkpw__field span {
	display: block;
	margin-bottom: .3rem;
	font-size: .82em;
	font-weight: 600;
}

.nkpw__field input {
	width: 100%;
	padding: .7rem .8rem;
	border: 1px solid var(--nkpw-line);
	border-radius: 4px;
	background: var(--nkpw-surface);
	font: inherit;
	color: inherit;
}

.nkpw__field input:focus {
	border-color: var(--nkpw-accent);
	outline: none;
	box-shadow: 0 0 0 2px rgba( 20, 107, 94, .15 );
}

.nkpw__hint {
	display: block;
	margin-top: .3rem;
	font-size: .76em;
	font-weight: 400;
	color: var(--nkpw-muted);
}

.nkpw__gate {
	padding: 1.15rem 1rem;
	border: 1px solid var(--nkpw-line);
	border-radius: 5px;
	background: var(--nkpw-tint);
	text-align: center;
}

.nkpw__gate-text {
	margin: 0 0 .3rem;
	font-size: .95em;
}

.nkpw__gate .nkpw__pay {
	display: inline-block;
	width: auto;
	min-width: 200px;
	text-decoration: none;
	text-align: center;
}

.nkpw__note {
	margin: .7rem 0 0;
	font-size: .78em;
	color: var(--nkpw-muted);
}

.nkpw__message {
	display: none;
	margin-top: 1rem;
	padding: .8rem 1rem;
	border-radius: 4px;
	font-size: .9em;
}

.nkpw__message--info {
	display: block;
	background: #eef3f8;
	color: #1b3c5e;
}

.nkpw__message--success {
	display: block;
	background: #e9f5ec;
	color: #14602a;
}

.nkpw__message--error {
	display: block;
	background: #fcebe9;
	color: #8a1c12;
}

.nkpw__login {
	margin: 1.1rem 0 0;
	padding-top: .9rem;
	border-top: 1px solid var(--nkpw-line);
	font-size: .85em;
	color: var(--nkpw-muted);
}

.nkpw__sep {
	margin: 0 .35em;
	opacity: .5;
}

.nkpw__login a {
	color: var(--nkpw-accent);
	font-weight: 600;
}

/* Session et connexion intégrée */

.nkpw__session {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: .5rem;
	margin: 0 0 1rem;
	padding: .55rem .8rem;
	border-radius: 4px;
	background: var(--nkpw-tint);
	font-size: .85em;
}

.nkpw__session-user {
	color: var(--nkpw-muted);
	overflow-wrap: anywhere;
}

.nkpw__logout {
	color: var(--nkpw-accent);
	font-weight: 600;
	text-decoration: underline;
	white-space: nowrap;
}

.nkpw__nosub {
	margin: 0 0 1.2rem;
	padding: .6rem .8rem;
	border-left: 3px solid var(--nkpw-accent);
	background: var(--nkpw-tint);
	font-size: .88em;
	color: var(--nkpw-muted);
}

.nkpw__signin {
	margin-top: 1.1rem;
	padding-top: .9rem;
	border-top: 1px solid var(--nkpw-line);
}

.nkpw__signin-title {
	margin: 0 0 .8rem;
	font-size: .9em;
	font-weight: 600;
}

.nkpw__signin-panel {
	max-width: 340px;
}

.nkpw__signin--external {
	margin-top: 1.1rem;
	padding-top: .9rem;
	border-top: 1px solid var(--nkpw-line);
}

.nkpw__signin-submit {
	display: block;
	width: 100%;
	max-width: 340px;
	text-align: center;
	text-decoration: none;
	padding: .7rem 1rem;
	border: 1px solid var(--nkpw-accent);
	border-radius: 4px;
	background: var(--nkpw-accent);
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.nkpw__signin-submit:hover,
.nkpw__signin-submit:focus-visible {
	filter: brightness( 1.12 );
}

.nkpw__signin-submit:disabled {
	opacity: .55;
	cursor: progress;
}

/* Le bloc de connexion peut être rendu hors du paywall (kiosque,
   bibliothèque) : il doit rester lisible sans les variables du bloc. */
.nkpw-kiosk__gate .nkpw__signin {
	max-width: 340px;
	margin-inline: auto;
	border-top: 0;
	text-align: left;
}

.nkpw-kiosk__gate .nkpw__signin-submit {
	border-color: #146B5E;
	background: #146B5E;
}

/* Fenêtre de connexion */

.nkpw-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}

.nkpw-modal[hidden] {
	display: none;
}

.nkpw-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba( 12, 16, 20, .6 );
}

.nkpw-modal__box {
	position: relative;
	width: 100%;
	max-width: 380px;
	max-height: 90vh;
	overflow-y: auto;
	padding: 1.75rem 1.5rem 1.25rem;
	border-radius: 6px;
	border-top: 3px solid var(--nkpw-accent, #146B5E);
	background: #fff;
	color: #14181c;
	box-shadow: 0 12px 40px rgba( 0, 0, 0, .3 );
	line-height: 1.5;
}

.nkpw-modal__box *,
.nkpw-modal__box *::before,
.nkpw-modal__box *::after {
	box-sizing: border-box;
}

.nkpw-modal__close {
	position: absolute;
	top: .4rem;
	right: .5rem;
	width: 2rem;
	height: 2rem;
	padding: 0;
	border: 0;
	background: none;
	color: #5b6670;
	font-size: 1.6rem;
	line-height: 1;
	cursor: pointer;
}

.nkpw-modal__title {
	margin: 0 0 .3rem;
	font-size: 1.3em;
}

.nkpw-modal__text {
	margin: 0 0 1.1rem;
	color: #5b6670;
	font-size: .9em;
}

.nkpw-modal .nkpw__field {
	display: block;
	margin-bottom: .8rem;
}

.nkpw-modal .nkpw__field span {
	display: block;
	margin-bottom: .3rem;
	font-size: .82em;
	font-weight: 600;
}

.nkpw-modal .nkpw__field input {
	width: 100%;
	padding: .7rem .8rem;
	border: 1px solid #e3e6e8;
	border-radius: 4px;
	background: #fff;
	font: inherit;
	color: inherit;
}

.nkpw-modal .nkpw__signin-submit {
	max-width: none;
	background: var(--nkpw-accent, #146B5E);
	border-color: var(--nkpw-accent, #146B5E);
}

.nkpw-modal .nkpw__message {
	margin-top: .8rem;
}

.nkpw-modal .nkpw__note {
	margin: .8rem 0 0;
	font-size: .82em;
	text-align: center;
}

/* Le déclencheur dans le bloc */

.nkpw__signin {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: .75rem;
	margin-top: 1.1rem;
	padding-top: .9rem;
	border-top: 1px solid var(--nkpw-line, #e3e6e8);
}

.nkpw__signin-title {
	font-size: .9em;
	color: var(--nkpw-muted, #5b6670);
}

.nkpw__signin .nkpw__signin-submit {
	width: auto;
	min-width: 160px;
	margin: 0;
	padding: .6rem 1.3rem;
}

/* Pastille dans les listes d'articles */

.nkpw-badge {
	display: inline-block;
	padding: .2em .55em;
	border-radius: 3px;
	background: var(--nkpw-accent, #146B5E);
	color: #fff;
	font-size: .68em;
	font-weight: 700;
	letter-spacing: .06em;
	line-height: 1.5;
	text-transform: uppercase;
	vertical-align: middle;
	white-space: nowrap;
}

/* Dans un titre, la pastille suit la taille du titre : on la ramène
   à une taille lisible sans écraser la ligne. */
h1 .nkpw-badge,
h2 .nkpw-badge,
h3 .nkpw-badge,
h4 .nkpw-badge,
.nkpw-badge + * {
	font-size: .6em;
}

.nkpw-badge:not(:only-child) {
	margin-right: .5em;
}

/* Bandeau en tête d'article */

.nkpw-flag {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: .6em;
	margin: 0 0 1.4em;
	padding: .6em 0;
	border-top: 1px solid var(--nkpw-accent, #146B5E);
	border-bottom: 1px solid #e3e6e8;
	font-size: .9rem;
	line-height: 1.4;
}

.nkpw-flag .nkpw-badge {
	font-size: .68rem;
}

.nkpw-flag__note {
	color: #5b6670;
}

.nkpw-flag--unlocked {
	border-top-style: dashed;
}

/* Espace abonné */

.nkpw-account__status {
	font-weight: 600;
}

.nkpw-account__status--active::before {
	content: "";
	display: inline-block;
	width: .6em;
	height: .6em;
	margin-right: .5em;
	border-radius: 50%;
	background: var(--nkpw-accent, #146B5E);
}

.nkpw-account__details {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: .4rem 1.5rem;
	margin: 1rem 0;
	font-size: .95em;
}

.nkpw-account__details dt {
	color: #5b6670;
}

.nkpw-account__details dd {
	margin: 0;
	font-weight: 600;
	text-align: right;
}

@media ( max-width: 480px ) {
	.nkpw {
		padding: 1.35rem 1.1rem 1.15rem;
	}

	.nkpw__plans {
		grid-template-columns: 1fr;
	}

	.nkpw__plan {
		text-align: left;
	}

	.nkpw__plan-badge {
		left: 1rem;
		transform: none;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.nkpw__choose,
	.nkpw__pay {
		transition: none;
	}
}
