/**
 * WebUp Lecture Progressive — styles
 *
 * UX onglets : 3 niveaux de lecture en onglets accessibles + footer (actions, partage).
 * Toutes les valeurs personnalisables passent par des variables CSS.
 *
 * @package WebUp_Lecture_Progressive
 */

/* -------------------------------------------------------------------------- */
/* Variables CSS (thémabilité)                                                 */
/* -------------------------------------------------------------------------- */

.wlp {
	/* Couleurs texte & fonds généraux */
	--wlp-color-text:           #1f1f1f;
	--wlp-color-text-muted:     #555;
	--wlp-color-bg:             #ffffff;
	--wlp-color-border:         #d8d8d8;

	/* Couleurs sémantiques par niveau */
	--wlp-niveau-1-color:       #2d5e99;  /* bleu moyen */
	--wlp-niveau-2-color:       #2e7a4c;  /* vert moyen */
	--wlp-niveau-3-color:       #a62828;  /* rouge soutenu */

	/* Typo */
	--wlp-font-family:          inherit;
	--wlp-font-size-base:       1rem;
	--wlp-line-height:          1.7;

	/* Espacements */
	--wlp-spacing-sm:           0.5rem;
	--wlp-spacing:              1rem;
	--wlp-spacing-lg:           2rem;
	--wlp-spacing-xl:           3rem;
	--wlp-spacing-2xl:          4.5rem;

	/* Formes */
	--wlp-radius:               12px;
	--wlp-radius-sm:            8px;
	--wlp-radius-pill:          999px;
	--wlp-border-width:         1px;

	/* Animations */
	--wlp-transition-fast:      180ms ease;
	--wlp-transition:           400ms ease-out;

	/* Reset container */
	display: block;
	color: var(--wlp-color-text);
	font-family: var(--wlp-font-family);
	font-size: var(--wlp-font-size-base);
	line-height: var(--wlp-line-height);
	margin: var(--wlp-spacing-lg) 0;
}

/* -------------------------------------------------------------------------- */
/* Onglets — liste                                                             */
/* -------------------------------------------------------------------------- */

.wlp-tabs {
	margin-top: var(--wlp-spacing-lg);
	margin-bottom: var(--wlp-spacing-lg);
}

.wlp-tabs__list {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.6rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Sélecteurs préfixés .wlp pour vaincre le reset Hello Elementor sur button (spécificité 0,2,0) */
.wlp .wlp-tabs__tab {
	display: inline-flex;
	align-items: center;
	column-gap: 0.7rem;
	padding: 0.65rem 1.4rem;
	background: transparent;
	border: 1px solid currentColor;
	border-bottom: none;
	border-radius: 30px 30px 0 0;
	font-family: 'Cinzel', Georgia, serif !important;
	font-size: 0.85rem;
	font-weight: 500;
	line-height: 1.4;
	text-transform: uppercase;
	letter-spacing: 0.18em;
	cursor: pointer;
	transition: background-color var(--wlp-transition-fast),
				color var(--wlp-transition-fast),
				transform var(--wlp-transition-fast);
}

.wlp .wlp-tabs__tab--1 { color: var(--wlp-niveau-1-color); }
.wlp .wlp-tabs__tab--2 { color: var(--wlp-niveau-2-color); }
.wlp .wlp-tabs__tab--3 { color: var(--wlp-niveau-3-color); }

.wlp .wlp-tabs__tab:hover {
	color: #ffffff;
}

.wlp .wlp-tabs__tab--1:hover { background-color: var(--wlp-niveau-1-color); border-color: var(--wlp-niveau-1-color); }
.wlp .wlp-tabs__tab--2:hover { background-color: var(--wlp-niveau-2-color); border-color: var(--wlp-niveau-2-color); }
.wlp .wlp-tabs__tab--3:hover { background-color: var(--wlp-niveau-3-color); border-color: var(--wlp-niveau-3-color); }

.wlp .wlp-tabs__tab.is-active {
	color: #ffffff;
}

.wlp .wlp-tabs__tab--1.is-active { background-color: var(--wlp-niveau-1-color); border-color: var(--wlp-niveau-1-color); }
.wlp .wlp-tabs__tab--2.is-active { background-color: var(--wlp-niveau-2-color); border-color: var(--wlp-niveau-2-color); }
.wlp .wlp-tabs__tab--3.is-active { background-color: var(--wlp-niveau-3-color); border-color: var(--wlp-niveau-3-color); }

.wlp .wlp-tabs__tab:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

.wlp-tabs__tab-dot {
	width: 0.5rem;
	height: 0.5rem;
	border-radius: 50%;
	background: currentColor;
	flex-shrink: 0;
}

.wlp-tabs__tab-roman {
	font-style: italic;
	letter-spacing: normal;
	font-weight: 500;
	margin-right: 0.1rem;
}

.wlp-tabs__tab-rank,
.wlp-tabs__tab-sep,
.wlp-tabs__tab-label {
	font-weight: 500;
}

.wlp-tabs__tab-sep {
	margin: 0 -0.2rem;
}

/* -------------------------------------------------------------------------- */
/* Séparateur sous les onglets — couleur dynamique selon onglet actif         */
/* -------------------------------------------------------------------------- */

.wlp-tabs__separator {
	height: 2px;
	margin: 0 0 var(--wlp-spacing-lg);
	background-color: var(--wlp-niveau-1-color);
	transition: background-color var(--wlp-transition-fast);
}

.wlp-tabs--active-1 .wlp-tabs__separator { background-color: var(--wlp-niveau-1-color); }
.wlp-tabs--active-2 .wlp-tabs__separator { background-color: var(--wlp-niveau-2-color); }
.wlp-tabs--active-3 .wlp-tabs__separator { background-color: var(--wlp-niveau-3-color); }

.wlp-tabs:has(.wlp-tabs__tab--1:hover) .wlp-tabs__separator { background-color: var(--wlp-niveau-1-color); }
.wlp-tabs:has(.wlp-tabs__tab--2:hover) .wlp-tabs__separator { background-color: var(--wlp-niveau-2-color); }
.wlp-tabs:has(.wlp-tabs__tab--3:hover) .wlp-tabs__separator { background-color: var(--wlp-niveau-3-color); }

/* -------------------------------------------------------------------------- */
/* Panneaux                                                                     */
/* -------------------------------------------------------------------------- */

.wlp-tabs__panel {
	padding: 0;
}

.wlp-tabs__panel[hidden] {
	display: none;
}

.wlp-tabs__panel > *:first-child {
	margin-top: 0;
}

.wlp-tabs__panel h2 {
	margin-top: var(--wlp-spacing-lg);
	margin-bottom: var(--wlp-spacing);
	font-size: 1.5rem;
	line-height: 1.3;
}

.wlp-tabs__panel h3 {
	margin-top: var(--wlp-spacing-lg);
	margin-bottom: var(--wlp-spacing-sm);
	font-size: 1.2rem;
	line-height: 1.4;
}

.wlp-tabs__panel blockquote {
	border-left: 3px solid #b8976a;
	padding: var(--wlp-spacing) var(--wlp-spacing-lg);
	margin: var(--wlp-spacing-lg) 0;
	color: var(--wlp-color-text-muted);
	font-style: italic;
}

.wlp-tabs__panel table {
	width: 100%;
	border-collapse: collapse;
	margin: var(--wlp-spacing) 0;
}

.wlp-tabs__panel th,
.wlp-tabs__panel td {
	padding: 0.6rem 0.8rem;
	border: var(--wlp-border-width) solid var(--wlp-color-border);
	text-align: left;
}

.wlp-tabs__panel th {
	background: #fafafa;
	font-weight: 600;
}

.wlp-tabs__panel ul,
.wlp-tabs__panel ol {
	margin: var(--wlp-spacing) 0 var(--wlp-spacing-lg) 0;
	padding-left: 2rem;
}

.wlp-tabs__panel li {
	margin-bottom: 0.3rem;
	line-height: 1.6;
}

.wlp-tabs__panel li:last-child {
	margin-bottom: 0;
}

/* -------------------------------------------------------------------------- */
/* Footer : séparateur, actions, partage                                      */
/* -------------------------------------------------------------------------- */

.wlp__footer {
	margin-top: var(--wlp-spacing-2xl);
	--wlp-footer-gold: #b8976a;
	--wlp-footer-text: #1f1f1f;
	--wlp-footer-icon: #6d1a1a;
}

.wlp__footer-divider {
	width: 100%;
	height: 6px;
	border-top: 1px solid var(--wlp-footer-gold);
	border-bottom: 1px solid var(--wlp-footer-gold);
	margin-bottom: var(--wlp-spacing-xl);
}

.wlp__footer .wlp__actions {
	display: flex;
	gap: var(--wlp-spacing-lg);
	justify-content: center;
	flex-wrap: wrap;
	padding: 0;
	border: none;
	margin: 0 0 var(--wlp-spacing-xl);
}

.wlp__footer .wlp__action {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 60px;
	padding: 1rem 2.2rem;
	background: transparent;
	border: 1px solid var(--wlp-footer-text);
	color: var(--wlp-footer-text);
	font-family: 'Cinzel', Georgia, serif !important;
	font-size: 0.8rem;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.18em;
	border-radius: 0;
	cursor: pointer;
	transition: all var(--wlp-transition-fast);
}

.wlp__footer .wlp__action:hover {
	background: var(--wlp-footer-text);
	color: #ffffff;
}

.wlp__footer .wlp__action:focus-visible {
	outline: 2px solid var(--wlp-footer-gold);
	outline-offset: 3px;
}

.wlp__share {
	display: flex;
	align-items: center;
	gap: var(--wlp-spacing-lg);
	flex-wrap: wrap;
	justify-content: center;
}

.wlp__share-line {
	flex: 1 1 60px;
	min-width: 40px;
	height: 1px;
	background: var(--wlp-footer-gold);
}

.wlp__share-label {
	flex: 0 0 auto;
	font-family: 'Cinzel', Georgia, serif !important;
	text-transform: uppercase;
	letter-spacing: 0.18em;
	font-size: 0.8rem;
	font-weight: 500;
	color: var(--wlp-footer-text);
}

.wlp__share-list {
	display: flex;
	gap: 0.8rem;
	list-style: none;
	padding: 0;
	margin: 0;
}

.wlp__share-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	border: 1px solid var(--wlp-footer-gold);
	background: transparent;
	color: var(--wlp-footer-icon);
	text-decoration: none;
	transition: all var(--wlp-transition-fast);
	cursor: pointer;
	padding: 0;
}

.wlp__share-link:hover,
.wlp__share-link:focus-visible {
	background: var(--wlp-footer-gold);
	color: #ffffff;
	outline: none;
}

.wlp__share-link svg {
	display: block;
}

/* -------------------------------------------------------------------------- */
/* Headers d'impression (cachés à l'écran, affichés par @media print)         */
/* -------------------------------------------------------------------------- */

.wlp__print-header,
.wlp-tabs__panel-print-label {
	display: none;
}

/* -------------------------------------------------------------------------- */
/* Screen-reader only                                                          */
/* -------------------------------------------------------------------------- */

.wlp__sr-announce {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* -------------------------------------------------------------------------- */
/* CBX Bookmark — n'afficher que l'instance dans le contenu d'article          */
/* -------------------------------------------------------------------------- */

body.single-post .cbxwpbkmarkwrap {
	display: none;
}

body.single-post .wlp-tabs__panel .cbxwpbkmarkwrap {
	display: block;
	margin-top: var(--wlp-spacing-lg);
}

/* -------------------------------------------------------------------------- */
/* Responsive                                                                  */
/* -------------------------------------------------------------------------- */

@media (max-width: 767px) {
	.wlp-tabs__list {
		flex-direction: column;
		gap: 0.4rem;
	}

	.wlp-tabs__tab {
		justify-content: center;
		width: 100%;
	}
}

@media (max-width: 640px) {
	.wlp__actions {
		flex-direction: column;
	}

	.wlp__action {
		width: 100%;
		justify-content: center;
	}

	.wlp__share {
		flex-direction: column;
		align-items: center;
		gap: 1.2rem;
	}

	.wlp__share-line {
		display: none;
	}

	.wlp__share-label {
		position: relative;
		padding-top: 1.4rem;
	}

	.wlp__share-label::before {
		content: '';
		position: absolute;
		top: 0;
		left: 50%;
		transform: translateX(-50%);
		width: 2.5rem;
		height: 1px;
		background: #b8976a;
	}

	.wlp__share-list {
		justify-content: center;
		gap: 1rem;
	}
}

/* -------------------------------------------------------------------------- */
/* Reduced motion                                                              */
/* -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.wlp-tabs__tab,
	.wlp-tabs__separator,
	.wlp__action {
		transition: none !important;
	}
}

/* -------------------------------------------------------------------------- */
/* Impression                                                                  */
/* -------------------------------------------------------------------------- */

@media print {
	/* Isoler le bloc .wlp : tout le reste de la page (header site, sidebar, footer, etc.)
	   est rendu invisible. .wlp reste visible et est repositionné en haut de la page. */
	body * {
		visibility: hidden !important;
	}

	.wlp,
	.wlp * {
		visibility: visible !important;
	}

	.wlp {
		position: absolute !important;
		left: 0 !important;
		top: 0 !important;
		width: 100% !important;
		margin: 0 !important;
		padding: 1rem !important;
		color: #000;
		background: #fff;
	}

	/* Navigation onglets, footer, séparateur : retirés */
	.wlp-tabs__list,
	.wlp-tabs__separator,
	.wlp__footer,
	.wlp__sr-announce {
		display: none !important;
	}

	.wlp-tabs__panel[hidden] {
		display: none !important;
	}

	.wlp-tabs__panel {
		page-break-inside: avoid;
	}

	/* Headers d'impression : titre du post + label du niveau actif */
	.wlp__print-header,
	.wlp-tabs__panel-print-label {
		display: block;
	}

	.wlp__print-title {
		font-size: 1.6rem;
		font-weight: 700;
		margin: 0 0 1.2rem;
		padding-bottom: 0.6rem;
		border-bottom: 1px solid #333;
		color: #000;
	}

	.wlp-tabs__panel-print-label {
		font-family: 'Cinzel', Georgia, serif;
		font-size: 0.85rem;
		font-weight: 600;
		text-transform: uppercase;
		letter-spacing: 0.18em;
		margin: 0 0 1rem;
		padding-bottom: 0.4rem;
		border-bottom: 1px solid currentColor;
	}

	.wlp-tabs__panel-print-label--1 { color: var(--wlp-niveau-1-color); }
	.wlp-tabs__panel-print-label--2 { color: var(--wlp-niveau-2-color); }
	.wlp-tabs__panel-print-label--3 { color: var(--wlp-niveau-3-color); }

	/* Widgets tiers injectés dans les panneaux (CBX Bookmark "Mettre en favori", etc.) */
	.wlp .cbxwpbkmarkwrap,
	.wlp [class*="cbxwpbkmark"] {
		display: none !important;
	}
}
