/* ==========================================================
   Template « chroniques » — Mohamed El Morabti
   ADN : Les chroniques du numérique (noir & blanc, Playfair, damier)
   ========================================================== */

/* ---------- Polices hébergées localement ---------- */
@font-face { font-family: "Playfair Display"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/playfair-display-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Playfair Display"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/playfair-display-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Playfair Display"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/playfair-display-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Open Sans"; font-style: normal; font-weight: 300; font-display: swap; src: url("../fonts/open-sans-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "Open Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/open-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Open Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/open-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Open Sans"; font-style: italic; font-weight: 300; font-display: swap; src: url("../fonts/open-sans-latin-300-italic.woff2") format("woff2"); }

/* ---------- Variables ---------- */
:root {
	--ink: #111;
	--ink-soft: #3a3a3a;
	--muted: #777;
	--line: #e7e7e7;
	--paper: #fff;
	--paper-alt: #f6f6f4;
	--accent: #e7383b;
	--serif: "Playfair Display", Georgia, "Times New Roman", serif;
	--sans: "Open Sans", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	--wrap: 1180px;
	--narrow: 720px;
	--radius: 0;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0;
	font-family: var(--sans);
	font-weight: 300;
	font-size: 17px;
	line-height: 1.75;
	color: var(--ink-soft);
	background: var(--paper);
	-webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); text-decoration: none; transition: color .2s, background-color .2s, border-color .2s; }
a:hover { color: var(--accent); }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; color: var(--ink); line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: clamp(2.1rem, 4.5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.45rem; }
h4 { font-size: 1.15rem; }
p { margin: 0 0 1.2em; }
strong, b { font-weight: 600; color: var(--ink); }
::selection { background: var(--ink); color: #fff; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 28px; }
.wrap-narrow { max-width: calc(var(--narrow) + 56px); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff; padding: 10px 16px; z-index: 100; }
.skip-link:focus { left: 10px; top: 10px; color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.kicker {
	font-family: var(--sans); font-weight: 600; font-size: .74rem;
	letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin: 0 0 1rem;
}
.kicker a { color: var(--muted); }
.kicker a:hover { color: var(--accent); }
.meta { font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 1rem; }
.meta::after { content: ""; display: block; width: 28px; height: 1px; background: var(--line); margin-top: .9rem; }

/* ---------- Boutons ---------- */
.btn {
	display: inline-block; font-family: var(--sans); font-weight: 600; font-size: .78rem;
	letter-spacing: .14em; text-transform: uppercase; padding: 15px 28px;
	background: var(--ink); color: #fff; border: 1px solid var(--ink);
}
.btn:hover { background: #fff; color: var(--ink); }
.btn-outline { background: transparent; color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: #fff; }
.btn-light { background: #fff; color: var(--ink); border-color: #fff; }
.btn-light:hover { background: transparent; color: #fff; }
.btns { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- En-tête ---------- */
.site-header { border-bottom: 1px solid var(--line); background: #fff; position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 92px; gap: 24px; }
.brand { display: flex; align-items: center; gap: 14px; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-emblem { width: 56px; height: 56px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-family: var(--serif); font-size: 1.35rem; }
.brand-sub { font-size: .68rem; letter-spacing: .2em; text-transform: lowercase; color: var(--muted); margin-top: 4px; }

.site-nav .menu { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.site-nav .menu a {
	display: block; padding: 10px 16px; font-size: .8rem; font-weight: 400;
	letter-spacing: .08em; text-transform: uppercase; color: #555;
}
.site-nav .menu a:hover { color: var(--ink); background: var(--paper-alt); }
.site-nav .menu .active > a { background: var(--ink); color: #fff; }

.nav-toggle { display: none; }
.nav-burger { display: none; cursor: pointer; width: 44px; height: 44px; padding: 12px 10px; }
.nav-burger span { display: block; height: 2px; background: var(--ink); margin-bottom: 6px; transition: transform .25s, opacity .25s; }

/* ---------- Héros (accueil) ---------- */
.hero { border-bottom: 1px solid var(--line); }
.hero-inner { display: grid; grid-template-columns: 1.25fr .75fr; gap: 64px; align-items: center; padding-top: 88px; padding-bottom: 88px; }
.hero h1 { margin-bottom: .35em; }
.hero .lead { font-size: 1.2rem; line-height: 1.7; color: var(--ink-soft); max-width: 36em; }
.hero-visual { position: relative; justify-self: center; }
.hero-visual img { width: min(340px, 70vw); aspect-ratio: 1; object-fit: cover; border-radius: 50%; }
.hero-visual::before {
	content: ""; position: absolute; inset: -18px; border: 1px solid var(--line); border-radius: 50%;
}
.hero-facts { display: flex; flex-wrap: wrap; gap: 8px 28px; list-style: none; padding: 0; margin: 2rem 0 2.2rem; font-size: .9rem; }
.hero-facts li { position: relative; padding-left: 16px; }
.hero-facts li::before { content: ""; position: absolute; left: 0; top: .72em; width: 6px; height: 6px; background: var(--ink); border-radius: 50%; }

/* ---------- Sections ---------- */
.section { padding: 88px 0; }
.section + .section, .band + .section { border-top: 1px solid var(--line); }
.section-head { text-align: center; margin: 0 auto 56px; max-width: 640px; }
.section-logo, .page-logo { margin: 0 auto 1.4rem; width: 302px; }
.section-intro { color: var(--muted); }
.section-more { text-align: center; margin: 56px 0 0; }
.section-title { text-align: center; }
.section-title::after { content: ""; display: block; width: 40px; height: 1px; background: var(--ink); margin: 1.1rem auto 0; }

.page-head { text-align: center; max-width: 680px; margin: 0 auto 56px; }
.page-intro { color: var(--muted); }

/* ---------- Damier ---------- */
.damier { display: grid; grid-template-columns: 1fr; }
.damier-item { display: grid; grid-template-columns: 1fr 1fr; min-height: 340px; background: #fff; }
.damier-item.is-reverse .damier-media { order: 2; }
.damier-media { display: block; overflow: hidden; background: var(--paper-alt); position: relative; }
.damier-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.damier-item:hover .damier-media img { transform: scale(1.04); }
.damier-media::after {
	content: ""; position: absolute; top: 50%; right: -1px; transform: translateY(-50%);
	border: 14px solid transparent; border-right-color: #fff;
}
.damier-item.is-reverse .damier-media::after { right: auto; left: -1px; border-right-color: transparent; border-left-color: #fff; }
.damier-body { padding: 48px 56px; display: flex; flex-direction: column; justify-content: center; }
.damier-title { font-size: clamp(1.4rem, 2.2vw, 1.9rem); margin-bottom: .5rem; }
.damier-title a:hover { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.excerpt { color: #666; margin-bottom: 1.2rem; }
.read-more { font-size: .74rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; align-self: flex-start; border-bottom: 1px solid var(--ink); padding-bottom: 3px; }
.read-more:hover { border-color: var(--accent); }

/* ---------- Cartes projets ---------- */
.cartes { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 32px; }
.carte { border: 1px solid var(--line); background: #fff; display: flex; flex-direction: column; transition: border-color .2s, transform .2s; }
.carte:hover { border-color: var(--ink); transform: translateY(-3px); }
.carte-media { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--paper-alt); border-bottom: 1px solid var(--line); }
.carte-media img { width: 100%; height: 100%; object-fit: cover; }
.carte-body { padding: 30px 32px 34px; display: flex; flex-direction: column; flex: 1; }
.carte-body p { color: #666; flex: 1; }

/* ---------- Bande noire (appel) ---------- */
.band { background: var(--ink); color: #cfcfcf; padding: 80px 0; text-align: center; }
.band h2 { color: #fff; }
.band p { max-width: 560px; margin-left: auto; margin-right: auto; }
.band .btns { justify-content: center; margin-top: 1.8rem; }

/* ---------- Article ---------- */
.article { padding: 72px 0 88px; }
.article-head { text-align: center; margin-bottom: 40px; }
.article-head .meta::after { margin-left: auto; margin-right: auto; }
.article.is-page .article-head { margin-bottom: 48px; }
.article-hero { margin: 0 auto 56px; max-width: 980px; }
.article-hero img { width: 100%; max-height: 520px; object-fit: cover; }
.article-body { font-size: 1.08rem; }
.article-body h2 { font-size: 1.75rem; margin-top: 2.2em; }
.article-body h3 { font-size: 1.35rem; margin-top: 1.8em; }
.article-body a { border-bottom: 1px solid var(--ink); }
.article-body a:hover { border-color: var(--accent); }
.article-body ul, .article-body ol { padding-left: 1.3em; margin: 0 0 1.4em; }
.article-body li { margin-bottom: .5em; }
.article-body blockquote {
	margin: 2em 0; padding: 0 0 0 28px; border-left: 2px solid var(--ink);
	font-family: var(--serif); font-style: italic; font-size: 1.3rem; color: var(--ink);
}
.article-body figure { margin: 2.2em 0; }
.article-body figcaption { font-size: .82rem; color: var(--muted); margin-top: .6em; text-align: center; }
.article-body .note-archive {
	background: var(--paper-alt); padding: 18px 22px; font-size: .9rem; color: #555; margin-bottom: 2.2em; border-left: 2px solid var(--ink);
}
.article-foot { margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--line); }

/* Parcours (timeline) */
.timeline { list-style: none; margin: 0 0 2em; padding: 0; border-left: 1px solid var(--line); }
.timeline li { position: relative; padding: 0 0 2em 30px; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: .55em; width: 9px; height: 9px; border-radius: 50%; background: var(--ink); }
.timeline .when { display: block; font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.timeline .what { font-family: var(--serif); font-size: 1.25rem; color: var(--ink); display: block; margin: .15em 0 .3em; }
.timeline p { margin: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0 !important; margin: 0 0 2em; }
.tags li { border: 1px solid var(--line); padding: 4px 12px; font-size: .82rem; margin: 0 !important; }

/* ---------- Contact (com_contact) ---------- */
.com-contact { padding: 72px 0 88px; }
.com-contact > *, .com-contact form { max-width: calc(var(--narrow) + 56px); margin-left: auto; margin-right: auto; padding-left: 28px; padding-right: 28px; }
.com-contact h1, .com-contact h2, .com-contact h3 { text-align: center; }
.com-contact .article-head { margin-bottom: 32px; }
.com-contact .page-intro p { margin: 0; }
.com-contact form h2, .com-contact form h3, .com-contact .contact-form > h2 { display: none; }
.com-contact .required-note, .com-contact form > p:first-child { font-size: .78rem; color: var(--muted); }
.com-contact .page-header h1, .com-contact .page-header h2 { font-size: clamp(2.1rem, 4.5vw, 3.2rem); }
.com-contact .contact-miscinfo, .com-contact .com-contact__miscinfo { text-align: center; color: #666; }
.com-contact fieldset { border: 0; padding: 0; margin: 0; }
.com-contact legend { display: none; }
.com-contact label { display: block; font-size: .78rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink); margin: 1.2em 0 .4em; }
.com-contact input[type=text], .com-contact input[type=email], .com-contact textarea {
	width: 100%; padding: 14px 16px; border: 1px solid #cfcfcf; font: inherit; font-weight: 400; background: #fff; border-radius: 0;
}
.com-contact input:focus, .com-contact textarea:focus { border-color: var(--ink); outline: none; }
.com-contact textarea { min-height: 180px; }
.com-contact .btn, .com-contact button[type=submit] {
	margin-top: 1.6em; display: inline-block; font-family: var(--sans); font-weight: 600; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase;
	padding: 15px 28px; background: var(--ink); color: #fff; border: 1px solid var(--ink); cursor: pointer;
}
.com-contact button[type=submit]:hover { background: #fff; color: var(--ink); }
.com-contact .form-check, .com-contact .checkbox { display: flex; gap: 10px; align-items: flex-start; }
.com-contact .form-check label { text-transform: none; letter-spacing: 0; font-weight: 400; margin: 0; }
.com-contact .star, .com-contact .form-control-feedback { color: var(--accent); }
.com-contact .accordion-button, .com-contact .contact-position, .com-contact .contact-address { display: none; }

/* Messages système */
#system-message-container joomla-alert, .alert { display: block; padding: 14px 18px; margin: 24px 0 0; border: 1px solid var(--ink); background: var(--paper-alt); }

/* ---------- Pied de page ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 48px 0; font-size: .88rem; color: var(--muted); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 18px 40px; justify-content: space-between; align-items: center; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 24px; list-style: none; padding: 0; margin: 0; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--ink); }
.copyright { margin: 0; }

/* ---------- Pagination ---------- */
.pagination-wrap { margin-top: 56px; text-align: center; }
.pagination-wrap ul { list-style: none; display: inline-flex; gap: 6px; padding: 0; }
.pagination-wrap a, .pagination-wrap span { display: block; padding: 8px 14px; border: 1px solid var(--line); }
.pagination-wrap .active span, .pagination-wrap .active a { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- Erreur ---------- */
.error-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.error-page img { margin-bottom: 2rem; }
.error-page h1 { max-width: 16em; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
	.hero-inner { grid-template-columns: 1fr; gap: 48px; padding-top: 56px; padding-bottom: 64px; text-align: center; }
	.hero .lead { margin-left: auto; margin-right: auto; }
	.hero-facts, .hero .btns { justify-content: center; }
	.hero-visual { order: -1; }
	.hero-visual img { width: min(240px, 60vw); }
	.damier-body { padding: 36px 36px; }
}
@media (max-width: 860px) {
	.nav-burger { display: block; }
	.site-nav {
		position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--line);
		max-height: 0; overflow: hidden; transition: max-height .3s ease;
	}
	.site-nav .menu { flex-direction: column; padding: 8px 28px 20px; gap: 0; }
	.site-nav .menu a { padding: 14px 12px; border-bottom: 1px solid var(--line); }
	.nav-toggle:checked ~ .site-nav { max-height: 420px; }
	.nav-toggle:checked + .nav-burger span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
	.nav-toggle:checked + .nav-burger span:nth-child(2) { opacity: 0; }
	.nav-toggle:checked + .nav-burger span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
	.header-inner { position: relative; min-height: 76px; }
}
@media (max-width: 720px) {
	body { font-size: 16px; }
	.wrap { padding: 0 20px; }
	.brand-emblem { width: 46px; height: 46px; }
	.brand-name { font-size: 1.15rem; }
	.section, .article { padding: 56px 0 64px; }
	.damier-item, .damier-item.is-reverse { grid-template-columns: 1fr; min-height: 0; }
	.damier-item.is-reverse .damier-media { order: 0; }
	.damier-media { aspect-ratio: 16 / 10; }
	.damier-media::after { display: none; }
	.damier-body { padding: 28px 4px 44px; }
	.section-logo, .page-logo { width: 240px; }
	.footer-inner { flex-direction: column; text-align: center; }
}
