/*
Theme Name:   AP'Pro
Description:  Thème enfant de GeneratePress pour l'espace privé AP'Pro : charte Pierre et or, menu latéral des modules et onglets en bas de page.
Author:       [Jean-Gabriel Hernando]
Template:     generatepress
Version:      0.1.0
Requires at least: 6.4
Requires PHP: 8.0
Text Domain:  appro
*/

/* ============ Charte « Pierre et or » : définie une seule fois ============ */
:root {
	--oe-fond: #F6F3EE;
	--oe-texte: #2F2F2F;
	--oe-principale: #707070;
	--oe-accent: #CA9B52;
	--oe-or-fonce: #8A6A2F;
	--oe-surface: #EDE8DF;
	--oe-trait: #DDD5C8;
	--oe-voile: rgba(47, 47, 47, 0.45);
	--oe-titres: 'Josefin Sans', Arial, sans-serif;
	--oe-corps: 'Lora', Georgia, serif;
	--oe-rayon: 6px;
	--oe-colonne: 720px;
}

/* ============ Base ============ */
html, body { background: var(--oe-fond); }
body {
	color: var(--oe-texte);
	font-family: var(--oe-corps);
	font-size: 16px;
	line-height: 1.5;
}
a { color: var(--oe-or-fonce); }
a:hover, a:focus { color: var(--oe-texte); }
:focus-visible { outline: 2px solid var(--oe-or-fonce); outline-offset: 2px; }

h1, h2, h3, h4, h5, h6 {
	font-family: var(--oe-titres);
	font-weight: 700;
	text-transform: none;
	letter-spacing: 0;
}
h1 { font-size: 32px; color: var(--oe-principale); }
h2 { font-size: 24px; color: var(--oe-principale); }
h3 { font-size: 19px; color: var(--oe-or-fonce); }

/* Une seule colonne centrée, comme Carnets perso */
.grid-container { max-width: calc(var(--oe-colonne) + 32px); }
.site-content { padding-top: 20px; }
.separate-containers .inside-article,
.one-container .site-content,
.separate-containers .comments-area,
.separate-containers .page-header,
.separate-containers .paging-navigation {
	background: transparent;
	padding: 0 16px 32px;
}
.entry-header .entry-title { display: none; } /* le titre est dans l'en-tête */

/* Boutons */
button, .button, input[type="submit"], input[type="button"], .wp-block-button__link, .oe-bouton {
	min-height: 44px;
	padding: 0 16px;
	border: none;
	border-radius: var(--oe-rayon);
	background: var(--oe-accent);
	color: var(--oe-texte);
	font-family: var(--oe-titres);
	font-weight: 700;
	cursor: pointer;
}
button:hover, .button:hover, input[type="submit"]:hover, .wp-block-button__link:hover, .oe-bouton:hover {
	background: var(--oe-accent);
	color: var(--oe-texte);
	filter: brightness(0.95);
}
.oe-bouton--contour {
	background: transparent;
	border: 1px solid var(--oe-principale);
	color: var(--oe-texte);
}

/* Champs */
input[type="text"], input[type="email"], input[type="password"], input[type="search"],
input[type="number"], input[type="date"], select, textarea {
	min-height: 46px;
	padding: 8px 12px;
	border: 1px solid var(--oe-principale);
	border-radius: var(--oe-rayon);
	background: var(--oe-fond);
	color: var(--oe-texte);
	font-family: var(--oe-corps);
	font-size: 16px;
}

/* Tableaux */
table { border-collapse: collapse; width: 100%; border: none; }
th { background: var(--oe-principale); color: #FFFFFF; font-family: var(--oe-titres); text-align: left; }
th, td { padding: 10px 14px; border: none; }
tbody tr:nth-child(even) { background: var(--oe-surface); }
tr.oe-important td { background: var(--oe-accent); color: var(--oe-texte); }

/* Cartes et encadrés réutilisables dans les pages */
.oe-carte { padding: 14px 16px; background: var(--oe-surface); border-radius: var(--oe-rayon); }
.oe-alerte { padding: 14px 16px; background: var(--oe-accent); color: var(--oe-texte); border-radius: var(--oe-rayon); }
.oe-alerte a { color: var(--oe-texte); font-weight: 600; }

/* ============ En-tête collant ============ */
.oe-entete {
	position: sticky;
	top: 0;
	z-index: 50;
	background: var(--oe-fond);
	border-bottom: 1px solid var(--oe-trait);
}
.admin-bar .oe-entete { top: 32px; }
.oe-entete__inner {
	max-width: var(--oe-colonne);
	margin: 0 auto;
	padding: 12px 16px;
	display: flex;
	align-items: center;
	gap: 12px;
}
.oe-entete__titres { flex: 1; min-width: 0; }
.oe-entete__titre {
	margin: 0;
	font-size: 24px;
	line-height: 1.15;
	color: var(--oe-principale);
	overflow-wrap: anywhere;
}
.oe-entete__sous-titre { margin: 2px 0 0; font-size: 14px; }
.oe-icone-bouton {
	width: 44px;
	height: 44px;
	min-height: 44px;
	flex: none;
	display: grid;
	place-items: center;
	padding: 0;
	border: 1px solid var(--oe-principale);
	border-radius: var(--oe-rayon);
	background: var(--oe-surface);
	color: var(--oe-texte);
}
.oe-icone-bouton:hover { background: var(--oe-surface); color: var(--oe-texte); filter: none; }
.oe-logo { flex: none; display: block; width: 40px; height: 40px; }
.oe-logo img { width: 40px; height: 40px; object-fit: contain; }

/* ============ Menu latéral des modules ============ */
.oe-tiroir { position: fixed; inset: 0; z-index: 100; visibility: hidden; }
.oe-tiroir.est-ouvert { visibility: visible; }
.oe-tiroir__voile {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	min-height: 0;
	padding: 0;
	border: none;
	border-radius: 0;
	background: var(--oe-voile);
	opacity: 0;
	transition: opacity .2s;
}
.oe-tiroir__voile:hover { background: var(--oe-voile); filter: none; }
.oe-tiroir.est-ouvert .oe-tiroir__voile { opacity: 1; }
.oe-tiroir__panneau {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	width: 300px;
	max-width: 86vw;
	background: var(--oe-fond);
	display: flex;
	flex-direction: column;
	overflow-y: auto;
	transform: translateX(-100%);
	transition: transform .2s;
}
.oe-tiroir.est-ouvert .oe-tiroir__panneau { transform: none; }
@media (prefers-reduced-motion: reduce) {
	.oe-tiroir__voile, .oe-tiroir__panneau { transition: none; }
}
.oe-tiroir__tete {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 16px;
	border-bottom: 1px solid var(--oe-trait);
}
.oe-tiroir__nom { flex: 1; font-family: var(--oe-titres); font-weight: 700; font-size: 18px; color: var(--oe-principale); }
.oe-tiroir__fermer { border: none; background: transparent; }
.oe-tiroir__fermer:hover { background: var(--oe-surface); }
.oe-modules { list-style: none; margin: 0; padding: 8px; display: flex; flex-direction: column; }
.oe-module {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	border-radius: var(--oe-rayon);
	color: var(--oe-texte);
	text-decoration: none;
}
.oe-module:hover, .oe-module[aria-current="page"] { background: var(--oe-surface); color: var(--oe-texte); }
.oe-module svg { flex: none; color: var(--oe-or-fonce); }
.oe-module__texte { display: flex; flex-direction: column; }
.oe-module__nom { font-family: var(--oe-titres); font-weight: 700; }
.oe-module__resume { font-size: 13px; }
.oe-tiroir__pied {
	margin-top: auto;
	padding: 14px 16px;
	border-top: 1px solid var(--oe-trait);
	display: flex;
	flex-direction: column;
	gap: 10px;
	font-size: 14px;
}
.oe-tiroir__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.oe-tiroir__actions a {
	display: inline-flex;
	align-items: center;
	min-height: 40px;
	padding: 0 12px;
	border: 1px solid var(--oe-principale);
	border-radius: var(--oe-rayon);
	color: var(--oe-texte);
	text-decoration: none;
}
body.oe-menu-ouvert { overflow: hidden; }

/* ============ Onglets du module, en bas ============ */
.oe-onglets {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 40;
	background: var(--oe-fond);
	border-top: 1px solid var(--oe-trait);
	padding-bottom: env(safe-area-inset-bottom, 0px);
}
.oe-onglets__inner {
	max-width: var(--oe-colonne);
	margin: 0 auto;
	padding: 8px 16px;
	display: grid;
	grid-auto-columns: minmax(0, 1fr);
	grid-auto-flow: column;
	gap: 8px;
}
.oe-onglet {
	display: grid;
	place-items: center;
	min-height: 48px;
	padding: 0 6px;
	border-radius: var(--oe-rayon);
	color: var(--oe-texte);
	text-align: center;
	text-decoration: none;
	font-family: var(--oe-titres);
	font-weight: 600;
	line-height: 1.2;
}
.oe-onglet:hover { background: var(--oe-surface); color: var(--oe-texte); }
.oe-onglet[aria-current="page"] { background: var(--oe-principale); color: #FFFFFF; font-weight: 700; }
body.oe-avec-onglets .site-footer { padding-bottom: 72px; }

/* ============ Pied de page ============ */
.site-info { background: var(--oe-surface); color: var(--oe-texte); font-size: 14px; }
.site-info a { color: var(--oe-or-fonce); }

/* ============ Page de connexion (wp-login.php) ============ */
body.login { background: var(--oe-fond); font-family: var(--oe-corps); }
.login form { background: var(--oe-surface); border: none; border-radius: var(--oe-rayon); box-shadow: none; }
.login label { font-family: var(--oe-titres); font-weight: 600; color: var(--oe-texte); }
.login .button-primary {
	background: var(--oe-accent) !important;
	border: none !important;
	color: var(--oe-texte) !important;
	font-family: var(--oe-titres);
	font-weight: 700;
	text-shadow: none;
	box-shadow: none;
	min-height: 44px;
	border-radius: var(--oe-rayon);
}
.login #nav a, .login #backtoblog a { color: var(--oe-or-fonce) !important; }
.login .message, .login .notice, .login #login_error { border-left-color: var(--oe-or-fonce); box-shadow: none; border-radius: var(--oe-rayon); }
.login h1 a {
	background-image: var(--oe-logo-connexion, none);
	background-size: contain;
	width: 80px;
	height: 80px;
}
.oe-connexion-titre { text-align: center; font-family: var(--oe-titres); font-weight: 700; font-size: 24px; color: var(--oe-principale); margin: 8px 0 4px; }
.oe-connexion-sous-titre { text-align: center; margin: 0 0 16px; color: var(--oe-texte); }
.oe-connexion-note { max-width: 320px; margin: 16px auto 0; font-size: 14px; text-align: center; color: var(--oe-texte); }
