/* ISHRAQA7 Magazine — système éditorial 2.1.4
 * Typographie de lecture, hiérarchie colorée des titres, encadrés pédagogiques,
 * mots-clés, lexique et navigation. Propriétés logiques : un seul code pour
 * l'arabe (RTL) et le français / l'anglais (LTR).
 */

:root {
	--ed-ink: #10263a;
	--ed-text: #2a3f52;
	--ed-gold: #c89d62;
	--ed-bronze: #8a6534;
	--ed-teal: #1c6e66;
	--ed-teal-bg: #eaf6f3;
	--ed-blue: #2b5c8a;
	--ed-blue-bg: #eaf2f9;
	--ed-amber-bg: #fbf4e6;
	--ed-red: #a23a2c;
	--ed-red-bg: #fbeeeb;
	--ed-line: #e6e3db;
}

/* --- 1. Texte courant ----------------------------------------------------- */

.entry {
	color: var(--ed-text);
	font-size: 17.5px;
	font-variant-numeric: lining-nums;
	hanging-punctuation: first;
}

.entry p,
.entry li {
	max-width: 72ch;
}

/* Chapeau : premier paragraphe du contenu, ou paragraphe marqué « ish-lead ». */
.entry > p:first-child,
.entry .ish-lead {
	font-size: 1.16em;
	line-height: 1.75;
	color: var(--ed-ink);
	font-weight: 500;
}

html[lang=ar] .entry > p:first-child,
html[lang=ar] .entry .ish-lead {
	line-height: 2;
}

.entry strong,
.entry b {
	color: var(--ed-ink);
	font-weight: 800;
}

.entry mark,
.entry .ish-hl {
	background: linear-gradient(transparent 58%, #f3deb9 58%);
	color: inherit;
	padding: 0 2px;
}

/* --- 2. Hiérarchie des titres -------------------------------------------- */

.entry h2 {
	position: relative;
	color: var(--ed-ink);
	font-weight: 800;
	line-height: 1.35;
	margin-top: 2.4em;
	padding-bottom: .5em;
	border-bottom: 1px solid var(--ed-line);
	text-wrap: balance;
}

.entry h2::after {
	content: '';
	position: absolute;
	inset-inline-start: 0;
	bottom: -2px;
	width: 68px;
	height: 3px;
	border-radius: 3px;
	background: var(--ed-gold);
}

.entry h3 {
	color: var(--ed-bronze);
	font-weight: 800;
	line-height: 1.45;
	padding-inline-start: 14px;
	border-inline-start: 3px solid var(--ed-gold);
	text-wrap: balance;
}

.entry h4 {
	color: var(--ed-teal);
	font-size: 16px;
	font-weight: 800;
	letter-spacing: .01em;
}

html[lang=fr] .entry h4,
html[lang=en] .entry h4 {
	text-transform: uppercase;
	font-size: 13.5px;
	letter-spacing: .08em;
}

.entry h5,
.entry h6 {
	color: var(--ed-blue);
	font-size: 15px;
	font-weight: 800;
	margin: 1.4em 0 0;
}

/* Surtitre de module : <p class="ish-over">Module 1</p> avant un <h2>. */
.entry .ish-over {
	margin: 3em 0 0;
	color: var(--ed-bronze);
	font: 800 12.5px/1.4 'DM Sans', 'Cairo', sans-serif;
	letter-spacing: .14em;
	text-transform: uppercase;
}

html[lang=ar] .entry .ish-over {
	font-family: 'Cairo', sans-serif;
	letter-spacing: 0;
	font-size: 14px;
}

.entry .ish-over + h2 {
	margin-top: .3em;
}

/* --- 3. Liens, listes, tableaux ----------------------------------------- */

.entry a:not(.btn):not(.ish-kw) {
	color: var(--ed-blue);
	text-decoration-color: rgba(43, 92, 138, .35);
	text-decoration-thickness: 1.5px;
	font-weight: 650;
}

.entry a:not(.btn):not(.ish-kw):hover {
	color: var(--ed-ink);
	text-decoration-color: var(--ed-gold);
}

.entry ul > li::marker {
	color: var(--ed-gold);
}

/* Étapes numérotées. */
.entry ol.ish-steps {
	list-style: none;
	padding: 0;
	counter-reset: ish-step;
}

.entry ol.ish-steps > li {
	position: relative;
	counter-increment: ish-step;
	padding-inline-start: 50px;
	min-height: 36px;
	max-width: none;
}

.entry ol.ish-steps > li + li {
	margin-top: 1em;
}

.entry ol.ish-steps > li::before {
	content: counter(ish-step);
	position: absolute;
	inset-inline-start: 0;
	top: 0;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: var(--ed-ink);
	color: #fff;
	font: 800 14px/34px 'DM Sans', sans-serif;
	text-align: center;
}

/* Liste de vérification. */
.entry ul.ish-check {
	list-style: none;
	padding: 0;
}

.entry ul.ish-check > li {
	position: relative;
	padding-inline-start: 32px;
}

.entry ul.ish-check > li::before {
	content: '';
	position: absolute;
	inset-inline-start: 2px;
	top: .5em;
	width: 17px;
	height: 17px;
	border-radius: 5px;
	background: var(--ed-teal) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.4l2.9 2.9 6.1-6.4' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/13px no-repeat;
}

.entry .table-scroll {
	overflow-x: auto;
	border: 1px solid var(--ed-line);
	border-radius: 12px;
	background: #fff;
}

.entry .table-scroll table {
	margin: 0;
	border: 0;
	min-width: 520px;
}

.entry .table-scroll th {
	background: var(--ed-ink);
	color: #fff;
	font-weight: 700;
	text-align: start;
}

.entry .table-scroll td,
.entry .table-scroll th {
	padding: 11px 14px;
	border: 0;
	border-bottom: 1px solid var(--ed-line);
	vertical-align: top;
}

.entry .table-scroll tr:nth-child(even) td {
	background: #faf8f4;
}

.entry .table-scroll tr:last-child td {
	border-bottom: 0;
}

.entry .table-scroll td:first-child {
	font-weight: 700;
	color: var(--ed-ink);
}

/* --- 4. Encadrés pédagogiques ------------------------------------------- */

.ish-box {
	margin-block: 1.6em;
	padding: 18px 22px 20px;
	border-radius: 14px;
	border: 1px solid var(--ed-line);
	border-inline-start: 5px solid var(--ed-gold);
	background: #fff;
	color: var(--ed-text);
}

.ish-box > * + * {
	margin-top: .7em;
}

.ish-box > :last-child {
	margin-bottom: 0;
}

.ish-box p,
.ish-box li {
	max-width: none;
}

.ish-box-title {
	margin: 0;
	font: 800 12.5px/1.5 'DM Sans', 'Cairo', sans-serif;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--ed-bronze);
}

html[lang=ar] .ish-box-title,
[dir=rtl] .ish-box-title {
	font-family: 'Cairo', sans-serif;
	font-size: 14.5px;
	letter-spacing: 0;
}

.ish-usecase {
	background: var(--ed-teal-bg);
	border-color: #cfe7e1;
	border-inline-start-color: var(--ed-teal);
}

.ish-usecase .ish-box-title,
.ish-exercise .ish-box-title {
	color: var(--ed-teal);
}

.ish-tip,
.ish-example {
	background: var(--ed-amber-bg);
	border-color: #f0e2c4;
	border-inline-start-color: var(--ed-gold);
}

.ish-warn {
	background: var(--ed-red-bg);
	border-color: #f1d5cf;
	border-inline-start-color: var(--ed-red);
}

.ish-warn .ish-box-title {
	color: var(--ed-red);
}

.ish-def,
.ish-goal {
	background: var(--ed-blue-bg);
	border-color: #d3e2f0;
	border-inline-start-color: var(--ed-blue);
}

.ish-def .ish-box-title,
.ish-goal .ish-box-title {
	color: var(--ed-blue);
}

.ish-exercise {
	background: #fff;
	border-inline-start-color: var(--ed-teal);
	box-shadow: 0 8px 26px rgba(11, 37, 58, .05);
}

.ish-key {
	background: var(--ed-ink);
	border-color: var(--ed-ink);
	border-inline-start-color: var(--ed-gold);
	color: #e8eef3;
}

.ish-key .ish-box-title {
	color: #ead2aa;
}

.ish-key strong,
.ish-key b,
.entry .ish-key strong {
	color: #fff;
}

.ish-key li::marker,
.entry .ish-key ul > li::marker {
	color: var(--ed-gold);
}

/* Modèle de prompt ou de formule à copier. */
.ish-prompt {
	margin-block: 1.4em;
	padding: 16px 20px;
	border-radius: 12px;
	background: #f4f1ea;
	border: 1px dashed #cdbf9f;
	color: var(--ed-ink);
	font-size: .95em;
	line-height: 1.8;
	white-space: pre-line;
}

.ish-prompt p,
.entry .ish-prompt {
	max-width: none;
}

/* Corrigé repliable. */
.entry details,
.ish-box details {
	border: 1px solid var(--ed-line);
	border-radius: 12px;
	background: #fff;
	padding: 0 18px;
}

.entry details > summary,
.ish-box details > summary {
	cursor: pointer;
	padding: 13px 0;
	font-weight: 800;
	color: var(--ed-teal);
}

.entry details[open] {
	padding-bottom: 16px;
}

.entry details[open] > summary {
	border-bottom: 1px solid var(--ed-line);
	margin-bottom: 14px;
}

/* Cartes de cas d'usage : <div class="ish-cards"><div class="ish-card">…</div></div>. */
.ish-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
	gap: 14px;
	margin-block: 1.6em;
}

.ish-card {
	background: #fff;
	border: 1px solid var(--ed-line);
	border-top: 4px solid var(--ed-gold);
	border-radius: 14px;
	padding: 18px 20px;
	font-size: .92em;
	line-height: 1.75;
}

.ish-card > * + * {
	margin-top: .55em;
}

.entry .ish-card h3,
.entry .ish-card h4,
.ish-card h3,
.ish-card h4 {
	margin: 0;
	padding: 0;
	border: 0;
	font-size: 16.5px;
	text-transform: none;
	letter-spacing: 0;
	color: var(--ed-ink);
}

.ish-card:nth-child(4n+2) {
	border-top-color: var(--ed-teal);
}

.ish-card:nth-child(4n+3) {
	border-top-color: var(--ed-blue);
}

.ish-card:nth-child(4n+4) {
	border-top-color: var(--ed-ink);
}

/* --- 5. Mots-clés et lexique -------------------------------------------- */

.ish-kw {
	display: inline-block;
	padding: 4px 13px;
	border-radius: 999px;
	background: #fff;
	border: 1px solid #dccfb6;
	color: var(--ed-bronze);
	font-size: 13.5px;
	font-weight: 700;
	line-height: 1.6;
	text-decoration: none;
	transition: background .15s, color .15s, border-color .15s;
}

.ish-kw:hover,
.ish-kw:focus-visible {
	background: var(--ed-ink);
	border-color: var(--ed-ink);
	color: #fff;
}

.ish-kwline {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	max-width: none;
}

.ish-keywords {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 10px 14px;
	margin-top: 44px;
	padding-top: 22px;
	border-top: 1px solid var(--ed-line);
}

.ish-keywords strong {
	font-size: 13px;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--ed-ink);
}

html[lang=ar] .ish-keywords strong {
	letter-spacing: 0;
	font-size: 15px;
}

.ish-keywords ul {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ish-term {
	position: relative;
	text-decoration: none;
	border-bottom: 2px dotted var(--ed-gold);
	cursor: help;
	color: var(--ed-ink);
	font-weight: 650;
}

.ish-term:focus-visible {
	outline: 2px solid var(--ed-gold);
	outline-offset: 2px;
	border-radius: 3px;
}

.ish-term::after {
	content: attr(data-def);
	position: absolute;
	z-index: 30;
	inset-inline-start: 0;
	top: calc(100% + 9px);
	width: max-content;
	max-width: min(340px, 78vw);
	padding: 12px 15px;
	border-radius: 11px;
	background: var(--ed-ink);
	color: #f2f5f7;
	font-size: 13.5px;
	font-weight: 500;
	line-height: 1.7;
	text-align: start;
	white-space: normal;
	box-shadow: 0 14px 38px rgba(7, 28, 43, .28);
	pointer-events: none;
	/* Masquée par « display » : une bulle invisible ne doit pas élargir la page. */
	display: none;
}

.ish-term:hover::after,
.ish-term:focus::after,
.ish-term.is-open::after {
	display: block;
}

/* La bulle s'ouvre vers l'autre côté quand le terme est près du bord. */
.ish-term.is-end::after {
	inset-inline-start: auto;
	inset-inline-end: 0;
}

.ish-lexicon {
	margin-top: 34px;
	padding: 26px 28px;
	background: #fff;
	border: 1px solid var(--ed-line);
	border-radius: 18px;
}

.ish-lexicon h2 {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	font-size: 20px;
	color: var(--ed-ink);
}

.ish-lexicon h2 .ico {
	width: 20px;
	height: 20px;
	color: var(--ed-gold);
}

.ish-lexicon > p {
	margin: 6px 0 16px;
	color: #687585;
	font-size: 14px;
}

.ish-lexicon dl {
	margin: 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 0 30px;
}

.ish-lexicon dl > div {
	padding-block: 13px;
	border-top: 1px solid var(--ed-line);
	scroll-margin-top: 170px;
}

.ish-lexicon dt {
	font-weight: 800;
	color: var(--ed-bronze);
}

.ish-lexicon dd {
	margin: 3px 0 0;
	font-size: 14.5px;
	line-height: 1.75;
	color: var(--ed-text);
}

/* --- 6. Navigation de parcours ------------------------------------------ */

.ish-next {
	margin-top: 52px;
}

.ish-next h2 {
	margin: 0;
	font-size: 22px;
	color: var(--ed-ink);
}

.ish-next > p {
	margin: 4px 0 18px;
	color: #687585;
	font-size: 14.5px;
}

.ish-next ul {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 14px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ish-next a {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 6px;
	height: 100%;
	padding: 18px 20px 44px;
	background: #fff;
	border: 1px solid var(--ed-line);
	border-radius: 16px;
	text-decoration: none;
	color: var(--ed-ink);
	transition: border-color .15s, box-shadow .15s, transform .15s;
}

.ish-next a:hover,
.ish-next a:focus-visible {
	border-color: var(--ed-gold);
	box-shadow: 0 14px 36px rgba(11, 37, 58, .09);
	transform: translateY(-2px);
}

.ish-next small {
	color: var(--ed-bronze);
	font-size: 12.5px;
	font-weight: 800;
}

.ish-next span {
	font-weight: 800;
	line-height: 1.5;
}

.ish-next .ico {
	position: absolute;
	inset-inline-end: 18px;
	bottom: 16px;
	width: 18px;
	height: 18px;
	color: var(--ed-gold);
}

/* Sommaire : rubrique en cours de lecture. */
.toc a.is-current {
	color: var(--ed-bronze);
	font-weight: 800;
	text-decoration: underline;
	text-decoration-color: var(--ed-gold);
	text-underline-offset: 4px;
}

/* Barre de progression de lecture. */
.ish-progress {
	position: fixed;
	z-index: 200;
	top: 0;
	inset-inline: 0;
	height: 3px;
	background: transparent;
	pointer-events: none;
}

.ish-progress i {
	display: block;
	height: 100%;
	width: 100%;
	background: linear-gradient(90deg, var(--ed-gold), #ead2aa);
	transform: scaleX(0);
	transform-origin: 0 50%;
}

[dir=rtl] .ish-progress i {
	transform-origin: 100% 50%;
}

/* --- 7. Mobile, mouvement réduit, impression ---------------------------- */

@media (max-width: 760px) {
	.entry {
		font-size: 16.5px;
	}

	.ish-box {
		padding: 16px 17px 18px;
	}

	.ish-lexicon {
		padding: 20px 18px;
	}

	/* Sur petit écran, la définition s'affiche en bas de l'écran, toujours lisible. */
	.ish-term::after {
		position: fixed;
		inset: auto 14px 14px 14px;
		top: auto;
		width: auto;
		max-width: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ish-next a,
	.ish-kw {
		transition: none;
	}
}

@media print {
	.ish-progress,
	.ish-next,
	.ish-keywords {
		display: none;
	}

	.ish-term {
		border: 0;
	}

	.ish-term::after {
		display: none;
	}

	.entry details > * {
		display: block;
	}
}

/* --- 8. Pages d'univers : formations puis articles (2.1.5) --------------- */

.list-title {
	display: flex;
	align-items: baseline;
	gap: 12px;
	margin: 0 0 22px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--ed-line);
	font-size: clamp(20px, 2.1vw, 26px);
	color: var(--ed-ink);
}

.list-title small {
	padding: 2px 11px;
	border-radius: 999px;
	background: var(--ed-ink);
	color: #fff;
	font: 800 12px/1.7 'DM Sans', sans-serif;
}

.list-courses {
	margin-bottom: 56px;
}

.list-courses + .list-title {
	margin-top: 8px;
}
