/*
Theme Name: Sanselec
Theme URI: https://sanselec.toubab.sn
Author: Sanselec
Author URI: https://sanselec.toubab.sn
Description: Thème éditorial et sobre pour Sanselec (sanselec.toubab.sn), le suivi communautaire des coupures de courant au Sénégal. Palette vert, jaune et rouge, typographie nette, pensé pour le mobile et les connexions lentes.
Version: 1.0.2
Requires at least: 6.2
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sanselec
Tags: custom-colors, custom-menu, editor-style, full-width-template, translation-ready
*/

:root {
	--ink: #0b1712;
	--ink-2: #37473f;
	--muted: #6d7b73;
	--green: #00853f;
	--green-600: #056f37;
	--green-900: #06341f;
	--yellow: #fdef42;
	--red: #e31b23;
	--paper: #faf8f1;
	--surface: #ffffff;
	--line: #e6e2d6;
	--font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--wrap: 1180px;
}

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

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--font);
	font-size: 16px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

body::before {
	content: "";
	position: fixed;
	inset: 0 0 auto;
	height: 320px;
	background: radial-gradient(60% 100% at 50% 0%, rgba(0, 133, 63, 0.07), transparent 70%);
	pointer-events: none;
	z-index: 0;
}

img,
svg {
	max-width: 100%;
	height: auto;
	vertical-align: middle;
}

a {
	color: var(--green-600);
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

a:hover {
	color: var(--green-900);
}

h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 0 0 0.5em;
	color: var(--ink);
	font-weight: 750;
	line-height: 1.15;
	letter-spacing: -0.02em;
}

p,
ul,
ol,
blockquote,
figure,
table {
	margin: 0 0 1.1em;
}

ul,
ol {
	padding-left: 1.3em;
}

code,
pre {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.9em;
}

::selection {
	background: var(--yellow);
	color: var(--ink);
}

:focus-visible {
	outline: 3px solid rgba(0, 133, 63, 0.5);
	outline-offset: 3px;
	border-radius: 4px;
}

/* ------------------------------------------------------------------ structure */

.skip-link {
	position: absolute;
	left: 12px;
	top: -60px;
	z-index: 999;
	padding: 10px 16px;
	border-radius: 8px;
	background: var(--ink);
	color: #fff;
	font-weight: 700;
	text-decoration: none;
	transition: top 0.18s ease;
}

.skip-link:focus {
	top: 12px;
	color: #fff;
}

.wrap {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: var(--wrap);
	margin: 0 auto;
	padding: 0 clamp(18px, 4vw, 32px);
}

.site-main {
	min-height: 60vh;
	padding: 26px 0 76px;
}

/* -------------------------------------------------------------------- header */

.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	border-bottom: 1px solid var(--line);
	background: rgba(250, 248, 241, 0.88);
	backdrop-filter: saturate(140%) blur(12px);
}

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 22px;
	min-height: 72px;
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: 11px;
	color: var(--ink);
	text-decoration: none;
}

.brand:hover {
	color: var(--ink);
}

.brand__mark {
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	border-radius: 11px;
	background: var(--green);
	box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.12);
}

.brand__mark svg {
	width: 20px;
	height: 20px;
	fill: var(--yellow);
}

.brand__text {
	font-size: 22px;
	font-weight: 800;
	letter-spacing: -0.04em;
	line-height: 1;
}

.brand__lockup {
	display: inline-flex;
	flex-direction: column;
	gap: 3px;
	line-height: 1;
}

.brand__domain {
	color: var(--muted);
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.08em;
	line-height: 1;
}

.nav {
	display: flex;
	align-items: center;
}

.nav ul {
	display: flex;
	align-items: center;
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.nav li {
	position: relative;
}

.nav a {
	display: inline-block;
	padding: 9px 12px;
	border-radius: 9px;
	color: var(--ink-2);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.nav a:hover {
	background: rgba(0, 133, 63, 0.08);
	color: var(--green-900);
}

.nav .current-menu-item > a,
.nav .current_page_item > a {
	color: var(--ink);
	box-shadow: inset 0 -2px 0 var(--green);
	border-radius: 9px 9px 0 0;
}

.nav .sub-menu {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	display: none;
	min-width: 210px;
	padding: 8px;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: #fff;
	box-shadow: 0 18px 40px -24px rgba(11, 23, 18, 0.45);
	flex-direction: column;
	align-items: stretch;
}

.nav li:hover > .sub-menu,
.nav li:focus-within > .sub-menu {
	display: flex;
}

.header-actions {
	display: flex;
	align-items: center;
	gap: 10px;
}

.header-user {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	padding: 4px 6px 4px 4px;
	border-radius: 999px;
	color: var(--ink);
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
}

.header-user:hover {
	background: rgba(0, 133, 63, 0.08);
	color: var(--ink);
}

.header-user img {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	object-fit: cover;
}

.btn-header {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	border-radius: 10px;
	background: var(--green);
	color: #fff;
	font-size: 13.5px;
	font-weight: 700;
	text-decoration: none;
	transition: background-color 0.16s ease, transform 0.16s ease;
}

.btn-header:hover {
	background: var(--green-600);
	color: #fff;
	transform: translateY(-1px);
}

.btn-header--ghost {
	border: 1px solid var(--line);
	background: #fff;
	color: var(--ink);
}

.btn-header--ghost:hover {
	border-color: var(--green);
	background: #fff;
	color: var(--ink);
}

.nav-toggle {
	display: none;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: #fff;
	color: var(--ink);
	font: inherit;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
}

/* -------------------------------------------------------------------- footer */

.site-footer {
	margin-top: 40px;
	padding: 56px 0 28px;
	background: var(--green-900);
	color: rgba(255, 255, 255, 0.72);
}

.site-footer a {
	color: rgba(255, 255, 255, 0.86);
	text-decoration: none;
}

.site-footer a:hover {
	color: var(--yellow);
}

.footer-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 0.7fr));
	gap: 36px;
}

.footer-brand .brand__text {
	color: #fff;
	font-size: 24px;
}

.footer-brand .brand__domain {
	display: block;
	margin-top: 6px;
	color: rgba(255, 255, 255, 0.5);
	font-size: 11px;
	letter-spacing: 0.1em;
}

.footer-brand p {
	max-width: 38ch;
	margin-top: 14px;
	font-size: 13.5px;
	line-height: 1.7;
}

.footer-col h2 {
	margin: 0 0 12px;
	color: #fff;
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.footer-col ul {
	display: grid;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 13.5px;
}

.footer-bottom {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: 44px;
	padding-top: 20px;
	border-top: 1px solid rgba(255, 255, 255, 0.14);
	font-size: 12px;
	color: rgba(255, 255, 255, 0.55);
}

.footer-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.footer-badge::before {
	content: "";
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--yellow);
}

/* --------------------------------------------------------------------- pages */

.prose {
	max-width: 70ch;
}

.prose h1 {
	margin: 18px 0 26px;
	font-size: clamp(2rem, 4vw, 3rem);
	font-weight: 800;
	letter-spacing: -0.035em;
	line-height: 1.05;
}

.prose h2 {
	margin: 38px 0 12px;
	padding-top: 18px;
	border-top: 1px solid var(--line);
	font-size: 20px;
}

.prose h3 {
	margin: 26px 0 8px;
	font-size: 17px;
}

.prose p,
.prose li {
	color: var(--ink-2);
	font-size: 15.5px;
}

.prose li {
	margin-bottom: 7px;
}

.prose blockquote {
	margin: 26px 0;
	padding: 18px 22px;
	border-left: 3px solid var(--green);
	background: #fff;
	color: var(--ink-2);
	font-style: italic;
}

.prose table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

.prose th,
.prose td {
	padding: 10px 12px;
	border-bottom: 1px solid var(--line);
	text-align: left;
}

.entry-header {
	max-width: 760px;
	margin-bottom: 26px;
}

.entry-title {
	font-size: clamp(1.9rem, 4vw, 2.8rem);
	font-weight: 800;
	letter-spacing: -0.035em;
	line-height: 1.06;
}

.entry-meta {
	color: var(--muted);
	font-size: 13px;
}

.entry-content > * {
	max-width: 760px;
}

.entry-content .alignwide {
	max-width: 100%;
}

.entry-content .alignfull {
	max-width: 100%;
}

.wp-block-image img,
.wp-caption img {
	border-radius: 12px;
}

/* ---------------------------------------------------------------- 404 etc. */

.error-404 {
	max-width: 560px;
	padding: 60px 0;
}

.error-404__code {
	font-size: clamp(4rem, 12vw, 7rem);
	font-weight: 800;
	line-height: 0.9;
	letter-spacing: -0.06em;
	color: var(--green);
}

.error-404 h1 {
	margin: 14px 0 8px;
	font-size: 26px;
}

.error-404 p {
	color: var(--muted);
}

.btn-solid {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: 12px;
	padding: 12px 20px;
	border-radius: 11px;
	background: var(--green);
	color: #fff;
	font-weight: 700;
	text-decoration: none;
}

.btn-solid:hover {
	background: var(--green-600);
	color: #fff;
}

/* --------------------------------------------------------------- WordPress */

.alignleft {
	float: left;
	margin: 0 20px 16px 0;
}

.alignright {
	float: right;
	margin: 0 0 16px 20px;
}

.aligncenter {
	display: block;
	margin-left: auto;
	margin-right: auto;
}

.wp-caption-text,
.gallery-caption {
	color: var(--muted);
	font-size: 12.5px;
}

.sticky {
	position: relative;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.screen-reader-text:focus {
	top: 8px;
	left: 8px;
	z-index: 100000;
	width: auto;
	height: auto;
	padding: 12px 18px;
	border-radius: 8px;
	background: #fff;
	color: var(--ink);
	clip: auto;
	font-size: 14px;
	font-weight: 700;
}

/* -------------------------------------------------------------- responsive */

@media (max-width: 900px) {
	.nav-toggle {
		display: inline-flex;
	}

	.nav {
		position: absolute;
		top: calc(100% + 1px);
		left: 0;
		right: 0;
		display: none;
		padding: 10px clamp(18px, 4vw, 32px) 18px;
		border-bottom: 1px solid var(--line);
		background: #fff;
		box-shadow: 0 22px 34px -28px rgba(11, 23, 18, 0.4);
	}

	.nav.is-open {
		display: block;
	}

	.nav ul {
		flex-direction: column;
		align-items: stretch;
		gap: 2px;
	}

	.nav a {
		display: block;
		padding: 12px 10px;
		font-size: 15px;
	}

	.nav .current-menu-item > a,
	.nav .current_page_item > a {
		box-shadow: inset 3px 0 0 var(--green);
		border-radius: 8px;
	}

	.nav .sub-menu {
		position: static;
		display: flex;
		padding-left: 12px;
		border: 0;
		box-shadow: none;
	}

	.header-actions .header-user span {
		display: none;
	}

	.footer-grid {
		grid-template-columns: 1fr;
		gap: 28px;
	}
}

@media (max-width: 560px) {
	.site-header__inner {
		min-height: 64px;
		gap: 12px;
	}

	.brand__text {
		font-size: 18px;
	}

	.brand__domain {
		font-size: 9px;
		letter-spacing: 0.05em;
	}

	.brand__mark {
		width: 34px;
		height: 34px;
	}

	.header-actions .btn-header--ghost {
		display: none;
	}

	.site-main {
		padding-top: 18px;
	}
}

@media (max-width: 380px) {
	.brand__domain {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.001ms !important;
		transition-duration: 0.001ms !important;
	}
}
