/*
Theme Name: TOUT AFRICA
Theme URI: https://www.toutafrica.com/
Author: TOUT AFRICA
Description: Thème sur mesure, épuré et léger pour TOUT AFRICA : une seule feuille de style, aucune police externe, un seul petit script, une hiérarchie de titres propre et des images optimisées pour le référencement et les Core Web Vitals. Conçu pour fonctionner avec Yoast SEO.
Version: 1.0.2
Requires at least: 6.3
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: toutafrica
Tags: news, blog, two-columns, right-sidebar, custom-logo, custom-menu, featured-images, translation-ready
*/

/* ---------- Variables ---------- */
:root {
	--brand: #1e73be;
	--brand-dark: #155b98;
	--brand-soft: #e8f1fa;
	--accent: #f2c400;
	--ink: #111827;
	--ink-2: #374151;
	--muted: #6b7280;
	--line: #e5e7eb;
	--bg: #ffffff;
	--bg-soft: #f5f7fa;
	--radius: 6px;
	--container: 1200px;
	--gap: 24px;
	--font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
	--font-read: Georgia, "Times New Roman", serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body {
	margin: 0;
	font: 16px/1.55 var(--font);
	color: var(--ink);
	background: var(--bg);
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
}
img, svg, video, iframe { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); text-decoration: underline; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; font-weight: 800; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.25em; }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 16px; }
.site-main { padding: 24px 0 48px; outline: none; }

.sr-only {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link:focus {
	position: fixed !important; top: 8px; left: 8px; width: auto; height: auto; clip: auto;
	padding: 10px 16px; background: var(--ink); color: #fff; z-index: 1000; border-radius: var(--radius);
}

/* ---------- En-tête ---------- */
.topbar { background: var(--ink); color: #cbd5e1; font-size: 13px; }
.topbar__inner { display: flex; justify-content: space-between; align-items: center; min-height: 34px; gap: 12px; }
.topbar__date { text-transform: capitalize; }
.topbar__links { display: flex; gap: 16px; }
.topbar a { color: #e5e7eb; }
.topbar a:hover { color: #fff; }
.topbar__donate { background: var(--accent); color: var(--ink) !important; padding: 3px 10px; border-radius: 3px; font-weight: 700; }

.site-header { background: var(--bg); border-bottom: 1px solid var(--line); }
.header__inner { display: flex; align-items: center; gap: 16px; padding-top: 14px; padding-bottom: 14px; }

.brand, .custom-logo-link { display: inline-flex; align-items: center; gap: 10px; color: var(--brand); text-decoration: none !important; }
.brand__mark { width: 44px; height: 44px; flex: none; }
.brand__text { display: flex; flex-direction: column; font-weight: 900; font-size: 20px; line-height: .95; letter-spacing: .02em; }
.custom-logo { max-height: 56px; width: auto; }

.header__search { margin-left: auto; width: 100%; max-width: 320px; }
.search-form { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--bg-soft); }
.search-form__input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 9px 14px; font: inherit; color: inherit; }
.search-form__input:focus { outline: none; }
.search-form:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.search-form__btn { border: 0; background: transparent; color: var(--muted); padding: 0 14px; cursor: pointer; }
.search-form__btn:hover { color: var(--brand); }

.nav-toggle { display: none; margin-left: auto; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); cursor: pointer; position: relative; }
.nav-toggle__bar, .nav-toggle__bar::before, .nav-toggle__bar::after {
	position: absolute; left: 11px; right: 11px; height: 2px; background: var(--ink); content: ""; transition: transform .2s, opacity .2s;
}
.nav-toggle__bar { top: 21px; }
.nav-toggle__bar::before { left: 0; right: 0; top: -7px; }
.nav-toggle__bar::after { left: 0; right: 0; top: 7px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar::after { transform: translateY(-7px) rotate(-45deg); }

.main-nav { background: var(--brand); }
.main-nav .menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.main-nav li { position: relative; }
.main-nav a { display: block; padding: 12px 14px; color: #fff; font-weight: 700; font-size: 15px; }
.main-nav a:hover, .main-nav .current-menu-item > a, .main-nav .current-category-ancestor > a, .main-nav .current-post-ancestor > a {
	background: var(--brand-dark); text-decoration: none; color: #fff;
}
.main-nav .menu-item-has-children > a::after { content: " ▾"; font-size: 12px; }
.main-nav .sub-menu {
	list-style: none; margin: 0; padding: 6px 0; position: absolute; top: 100%; left: 0; min-width: 210px; z-index: 50;
	background: var(--bg); border: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); box-shadow: 0 12px 24px rgba(17,24,39,.12);
	opacity: 0; visibility: hidden; transform: translateY(4px); transition: opacity .15s, transform .15s, visibility .15s;
}
.main-nav li:hover > .sub-menu, .main-nav li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.main-nav .sub-menu a { color: var(--ink); font-weight: 600; padding: 8px 16px; }
.main-nav .sub-menu a:hover { background: var(--brand-soft); color: var(--brand-dark); }

/* ---------- Titres de section ---------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-title { font-size: 20px; text-transform: uppercase; letter-spacing: .04em; border-bottom: 2px solid var(--line); margin: 0 0 18px; flex: 1; }
.section-title span { display: inline-block; border-bottom: 3px solid var(--brand); padding-bottom: 6px; margin-bottom: -2px; }
.section-title a { color: var(--ink); }
.section-title a:hover { color: var(--brand); text-decoration: none; }
.section-more { font-size: 14px; font-weight: 700; white-space: nowrap; }

/* ---------- Cartes ---------- */
.card { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.card__media { display: block; overflow: hidden; border-radius: var(--radius); background: var(--bg-soft); aspect-ratio: 16 / 9; }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.card:hover .card__media img { transform: scale(1.03); }
.card__title { font-size: 17px; font-weight: 750; margin: 2px 0 4px; }
.card__title a { color: var(--ink); }
.card__title a:hover { color: var(--brand); text-decoration: none; }
.card__excerpt { color: var(--ink-2); font-size: 15px; margin: 0 0 6px; }
.kicker { display: inline-block; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--brand); }
.meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: 13px; }
.meta a { color: var(--ink-2); font-weight: 600; }

.card--hero .card__title { font-size: clamp(22px, 3vw, 32px); line-height: 1.15; }
.card--hero .card__excerpt { font-size: 17px; }

.card--row { flex-direction: row; gap: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.card--row:last-child { border-bottom: 0; padding-bottom: 0; }
.card--row .card__media { flex: 0 0 120px; height: 80px; aspect-ratio: auto; }
.card--row .card__title { font-size: 15px; }

/* ---------- Grilles ---------- */
.grid { display: grid; gap: var(--gap); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--3 .card--wide { grid-column: 1 / -1; display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--gap); align-items: center; }
.grid--3 .card--wide .card__title { font-size: clamp(22px, 2.6vw, 30px); }

/* ---------- Accueil ---------- */
.lead { margin-bottom: 40px; }
.lead__grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 28px; }
.lead__side { display: flex; flex-direction: column; gap: 14px; }

.flash { margin-bottom: 40px; background: var(--bg-soft); border-radius: var(--radius); padding: 20px 20px 8px; }
.flash .section-title { border-bottom-color: #dfe5ec; }
.flash__list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 28px; }
.flash__list li { padding: 10px 0 12px; border-bottom: 1px solid #dfe5ec; }
.flash__list .date { font-size: 12px; color: var(--brand); font-weight: 700; }
.flash__title { font-size: 15px; font-weight: 700; margin: 4px 0 0; }
.flash__title a { color: var(--ink); }

.rubric { margin-bottom: 44px; }

/* ---------- Article ---------- */
.breadcrumbs { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.breadcrumbs a { color: var(--muted); }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; align-items: start; }
.entry { min-width: 0; max-width: 760px; }
.entry__title { font-size: clamp(28px, 4vw, 42px); line-height: 1.12; margin: 8px 0 14px; }
.entry__standfirst { font-size: 20px; line-height: 1.5; color: var(--ink-2); font-weight: 500; }
.entry__meta { padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 16px 0 22px; }
.entry__media { margin: 0 0 26px; }
.entry__media img { width: 100%; border-radius: var(--radius); }
.entry__media figcaption, .entry__content figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; }

.entry__content { font-family: var(--font-read); font-size: 19px; line-height: 1.75; color: #1f2937; overflow-wrap: break-word; }
.entry__content > * { margin-top: 0; margin-bottom: 1.15em; }
.entry__content h2, .entry__content h3, .entry__content h4 { font-family: var(--font); margin-top: 1.6em; }
.entry__content h2 { font-size: 26px; }
.entry__content h3 { font-size: 21px; }
.entry__content a { text-decoration: underline; text-underline-offset: 2px; }
.entry__content img { border-radius: var(--radius); }
.entry__content blockquote { margin-left: 0; padding: 4px 0 4px 20px; border-left: 4px solid var(--brand); font-style: italic; color: var(--ink-2); }
.entry__content table { width: 100%; border-collapse: collapse; font-family: var(--font); font-size: 15px; }
.entry__content th, .entry__content td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.entry__content .wp-block-embed, .entry__content iframe { max-width: 100%; }
.alignwide { margin-left: -40px; margin-right: -40px; max-width: none; }
.alignfull { width: 100vw; margin-left: calc(50% - 50vw); max-width: none; }
.aligncenter { margin-left: auto; margin-right: auto; }
.alignleft { float: left; margin: .3em 1.2em 1em 0; }
.alignright { float: right; margin: .3em 0 1em 1.2em; }
.wp-caption-text { font-size: 13px; color: var(--muted); }

.entry__footer { margin-top: 32px; display: flex; flex-direction: column; gap: 22px; }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.share__label { font-weight: 800; font-size: 14px; margin-right: 4px; }
.share__link { padding: 7px 14px; border-radius: 999px; font-size: 14px; font-weight: 700; color: #fff !important; text-decoration: none !important; }
.share__link--facebook { background: #1877f2; }
.share__link--x { background: #111; }
.share__link--whatsapp { background: #128c4b; }
.share__link--telegram { background: #1d8ed1; }
.share__link:hover { filter: brightness(.92); }
.tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags a { display: block; padding: 5px 12px; background: var(--bg-soft); border-radius: 999px; font-size: 13px; color: var(--ink-2); }
.tags a:hover { background: var(--brand-soft); color: var(--brand-dark); text-decoration: none; }
.author-box { display: flex; gap: 16px; padding: 18px; background: var(--bg-soft); border-radius: var(--radius); }
.author-box img { border-radius: 50%; flex: none; }
.author-box__name { font-weight: 800; margin: 0 0 4px; }
.author-box__bio { margin: 0; color: var(--ink-2); font-size: 15px; }

.sidebar { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 28px; }
.widget-title { font-size: 16px; text-transform: uppercase; letter-spacing: .05em; padding-bottom: 8px; border-bottom: 3px solid var(--brand); display: inline-block; }
.mini-list { list-style: none; counter-reset: n; padding: 0; margin: 0; }
.mini-list li { counter-increment: n; position: relative; padding: 10px 0 10px 38px; border-bottom: 1px solid var(--line); }
.mini-list li::before { content: counter(n); position: absolute; left: 0; top: 8px; font-size: 24px; font-weight: 900; color: var(--brand-soft); -webkit-text-stroke: 1px var(--brand); }
.mini-list a { display: block; color: var(--ink); font-weight: 700; font-size: 15px; line-height: 1.35; margin-bottom: 4px; }
.mini-list .date { font-size: 12px; color: var(--muted); }

.related { margin-top: 56px; }
.comments { margin-top: 48px; max-width: 760px; }
.comment-list { padding-left: 0; list-style: none; }

/* ---------- Archives ---------- */
.archive-header { padding: 8px 0 22px; margin-bottom: 26px; border-bottom: 1px solid var(--line); }
.archive-title { font-size: clamp(28px, 4vw, 40px); margin: 0; }
.archive-description { color: var(--ink-2); max-width: 760px; margin-top: 10px; }
.archive-search { max-width: 480px; margin-top: 14px; }
.pagination { margin-top: 40px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.pagination .page-numbers { display: inline-block; min-width: 42px; padding: 9px 12px; text-align: center; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); font-weight: 700; }
.pagination .page-numbers.current, .pagination a.page-numbers:hover { background: var(--brand); border-color: var(--brand); color: #fff; text-decoration: none; }

/* ---------- Pied de page ---------- */
.site-footer { background: #0b1220; color: #cbd5e1; margin-top: 24px; }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding-top: 44px; padding-bottom: 36px; }
.site-footer .brand { color: #fff; }
.site-footer .brand__mark { color: var(--brand); }
.footer__about p { margin-top: 14px; max-width: 380px; }
.footer__title { font-size: 14px; text-transform: uppercase; letter-spacing: .08em; color: #fff; }
.footer__menu { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 20px; }
.footer__contact .footer__menu { columns: 1; }
.footer__menu li { margin-bottom: 8px; break-inside: avoid; }
.site-footer a { color: #cbd5e1; }
.site-footer a:hover { color: #fff; }
.footer__bottom { border-top: 1px solid #1f2a3d; font-size: 13px; }
.footer__bottom-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding-top: 16px; padding-bottom: 16px; }

/* ---------- Biographies (extension WikiBiographie) ---------- */
.default-max-width { max-width: 860px; margin: 0 auto; }
.default-max-width > a:first-child { display: inline-block; font-size: 14px; font-weight: 700; margin-bottom: 14px; }
.default-max-width > ul { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.default-max-width > ul a { display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); font-weight: 700; }
.default-max-width > ul a:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.default-max-width form { display: flex; gap: 8px; margin: 16px 0 24px; max-width: 480px; }
.default-max-width form input[type=text] { flex: 1; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); font: inherit; }
.default-max-width form input[type=submit] { padding: 10px 18px; border: 0; border-radius: var(--radius); background: var(--brand); color: #fff; font-weight: 700; cursor: pointer; }
.bio-table { width: 100%; border-collapse: collapse; margin-top: 18px; }
.bio-table th, .bio-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.bio-table th { width: 32%; background: var(--bg-soft); font-size: 14px; color: var(--ink-2); }
.bio-table td { font-family: var(--font-read); font-size: 17px; line-height: 1.65; }
.bio-table img { border-radius: var(--radius); }
@media (max-width: 560px) {
	.default-max-width > ul { grid-template-columns: minmax(0, 1fr); }
	.bio-table th, .bio-table td { display: block; width: auto; }
	.bio-table th { border-bottom: 0; padding-bottom: 4px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
	.grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.layout { grid-template-columns: minmax(0, 1fr); gap: 32px; }
	.sidebar { position: static; }
	.entry { max-width: none; }
	.flash__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.alignwide { margin-left: 0; margin-right: 0; }
}
@media (max-width: 820px) {
	.lead__grid, .grid--3 { grid-template-columns: minmax(0, 1fr); }
	.grid--3 .card--wide { grid-template-columns: minmax(0, 1fr); }
	.footer__grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
	.topbar__date { display: none; }
	.topbar__inner { justify-content: flex-end; }

	.header__inner { flex-wrap: wrap; }
	.nav-toggle { display: block; }
	.header__search { order: 3; max-width: none; margin-left: 0; }
	.main-nav { display: none; }
	.main-nav.is-open { display: block; }
	.main-nav .menu { flex-direction: column; padding: 6px 0; }
	.main-nav a { padding: 12px 4px; border-bottom: 1px solid rgba(255,255,255,.15); }
	.main-nav .sub-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; background: transparent; padding: 0 0 0 14px; }
	.main-nav .sub-menu a { color: #fff; font-weight: 600; }
	.main-nav .sub-menu a:hover { background: var(--brand-dark); color: #fff; }
}
@media (max-width: 560px) {
	.grid--4, .flash__list { grid-template-columns: minmax(0, 1fr); }
	.entry__content { font-size: 18px; }
	.entry__standfirst { font-size: 18px; }
	.card--row .card__media { flex-basis: 100px; height: 68px; }
}
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Impression ---------- */
@media print {
	.topbar, .main-nav, .header__search, .nav-toggle, .sidebar, .share, .related, .comments, .site-footer { display: none !important; }
	.layout { display: block; }
	.entry__content { font-size: 12pt; }
}
