/*
Theme Name: Master ESC
Theme URI: https://master-esc.com/
Description: Thème autonome pour Master ESC. Remplace GeneratePress / GP Premium (pied de page compris) et WP Show Posts (le shortcode [wp_show_posts] fonctionne sans le plugin). Reprend les couleurs et la mise en page de GeneratePress pour que les blocs GenerateBlocks existants s'affichent à l'identique.
Author: Lisara Agency
Version: 1.3.0
Requires at least: 6.3
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: master-esc
*/

/* =========================================================================
   Variables (mêmes noms que GeneratePress : utilisées par les blocs)
   ========================================================================= */
:root {
	--contrast: #222222;
	--contrast-2: #575760;
	--contrast-3: #b2b2be;
	--base: #f0f0f0;
	--base-2: #f5f5f5;
	--base-3: #ffffff;
	--accent: #3270fc;
	--primary2: #d2093c;
	--btn: #0366d6;
	--container: 1200px;
	--font: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

/* Classes de couleur GeneratePress (variante sans tiret) */
:root .has-primary2-color { color: var(--primary2); }
:root .has-primary2-background-color { background-color: var(--primary2); }

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

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

body {
	margin: 0;
	background-color: var(--base-3);
	color: var(--contrast);
	font-family: var(--font);
	font-size: 17px;
	line-height: 1.5;
	overflow-x: hidden;
}

img { max-width: 100%; height: auto; vertical-align: middle; }
iframe, embed, object, video { max-width: 100%; }

a { color: var(--accent); text-decoration: underline; }
a:hover, a:focus, a:active { color: var(--contrast); }
.entry-title a, .site-logo, .main-navigation a, a.button, .wp-block-button__link, .btn { text-decoration: none; }

h1, h2, h3, h4, h5, h6 {
	font-family: inherit;
	font-weight: 400;
	line-height: 1.2;
	margin: 0 0 20px;
	text-transform: none;
}
h1 { font-size: 42px; }
h2 { font-size: 35px; }
h3 { font-size: 29px; }
h4 { font-size: 24px; }
h5 { font-size: 20px; }

p { margin: 0 0 1.5em; }
ul, ol { margin: 0 0 1.5em 3em; padding: 0; }
li > ul, li > ol { margin-bottom: 0; margin-left: 1.5em; }
blockquote {
	border-left: 5px solid rgba(0, 0, 0, .05);
	padding: 20px;
	font-size: 1.2em;
	font-style: italic;
	margin: 0 0 1.5em;
}
hr { background-color: rgba(0, 0, 0, .1); border: 0; height: 1px; margin: 40px 0; }
table { border-collapse: separate; border-spacing: 0; border-width: 1px 0 0 1px; margin: 0 0 1.5em; width: 100%; }
table, td, th { border: 1px solid rgba(0, 0, 0, .1); }
td, th { padding: 8px; }
th { font-weight: 700; }
figure { margin: 0; }
sup { font-size: 75%; line-height: 0; position: relative; top: -.5em; }

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
}
.skip-link:focus {
	clip: auto; clip-path: none;
	width: auto; height: auto; margin: 0;
	top: 5px; left: 5px; z-index: 100000;
	background: #fff; padding: 15px 23px;
}

/* Boutons et champs (valeurs GeneratePress) */
button, html input[type="button"], input[type="reset"], input[type="submit"],
a.button, a.wp-block-button__link:not(.has-background), .btn {
	border: 1px solid transparent;
	background-color: #55555e;
	color: #fff;
	padding: 10px 20px;
	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
	cursor: pointer;
	-webkit-appearance: button;
}
button:hover, input[type="submit"]:hover, a.button:hover, .btn:hover,
a.wp-block-button__link:not(.has-background):hover { background-color: #3f4047; color: #fff; }
.btn { display: inline-block; background-color: var(--btn); }

.wp-block-button__link {
	border-radius: 0;
	font-size: 17px;
	padding: 15px 20px;
	line-height: 1;
}

input[type="text"], input[type="email"], input[type="url"], input[type="password"],
input[type="search"], input[type="tel"], input[type="number"], textarea, select {
	color: var(--contrast);
	background-color: var(--base-2);
	border: 1px solid var(--base);
	border-radius: 0;
	padding: 10px 15px;
	max-width: 100%;
	font: inherit;
}
input:focus, textarea:focus, select:focus { border-color: var(--contrast-3); outline: 0; }
.search-form { display: flex; gap: 6px; margin-bottom: 1.5em; }

/* =========================================================================
   En-tête
   ========================================================================= */
.site-header { background-color: var(--base-3); position: relative; z-index: 100; }

.inside-header {
	display: flex;
	align-items: center;
	max-width: var(--container);
	margin: 0 auto;
	padding: 20px 40px;
}
.site-logo { display: inline-block; margin-right: auto; }
.site-logo .header-image { width: 140px; height: auto; }
.site-title { font-size: 25px; font-weight: 700; color: var(--contrast); }

.main-navigation ul { list-style: none; margin: 0; padding: 0; }
.main-navigation > ul { display: flex; flex-wrap: wrap; }
.main-navigation li { position: relative; }
.main-navigation a {
	display: block;
	padding: 0 12px;
	line-height: 60px;
	font-size: 15px;
	color: var(--contrast);
}
.main-navigation li:hover > a,
.main-navigation li:focus-within > a,
.main-navigation li[class*="current-menu-"] > a { color: var(--accent); }

.main-navigation .sub-menu {
	position: absolute;
	top: 100%;
	right: 0;
	width: 200px;
	background-color: var(--base);
	box-shadow: 1px 1px 0 rgba(0, 0, 0, .1);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 80ms linear;
	z-index: 99999;
}
.main-navigation .sub-menu a { line-height: normal; padding: 10px 12px; font-size: 14px; }
.main-navigation .sub-menu .sub-menu { top: 0; right: 100%; }
.main-navigation li:hover > .sub-menu,
.main-navigation li:focus-within > .sub-menu { opacity: 1; visibility: visible; pointer-events: auto; }

.menu-toggle, .submenu-toggle { display: none; }

/* =========================================================================
   Bandeau titre (remplace l'Element « Page Hero » de GP Premium)
   ========================================================================= */
.page-hero {
	position: relative;
	overflow: hidden;
	background-image: linear-gradient(148deg, var(--accent), var(--primary2));
}
.page-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image: var(--hero-bg, none);
	background-repeat: no-repeat;
	background-position: center center;
	background-size: cover;
	opacity: .3;
	pointer-events: none;
}
.page-hero-inner {
	position: relative;
	z-index: 1;
	max-width: var(--container);
	margin: 0 auto;
	padding: 80px 30px 200px;
}
.page-hero-title {
	margin: 0;
	font-size: 60px;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	color: var(--base-3);
}
.page-hero-shape {
	position: absolute;
	left: 0; right: 0; bottom: -1px;
	line-height: 0;
	color: var(--base-3);
	transform: scaleX(-1);
	pointer-events: none;
}
.page-hero-shape svg {
	position: relative;
	left: 50%;
	transform: translateX(-50%);
	width: calc(100% + 1.3px);
	min-width: 100%;
	height: 94px;
	fill: currentColor;
}

/* =========================================================================
   Mise en page (GeneratePress « conteneurs séparés »)
   ========================================================================= */
.site-content {
	display: flex;
	max-width: var(--container);
	margin: 0 auto;
}
.content-area { flex: 1 1 100%; min-width: 0; }
.site-main { margin: 20px; }
.right-sidebar .content-area { flex: 0 0 70%; width: 70%; }
.right-sidebar .site-main { margin: 20px 20px 20px 0; }
.widget-area { flex: 0 0 30%; width: 30%; min-width: 0; }
.inside-right-sidebar { margin: 20px 0; }

.inside-article { padding: 40px; background-color: var(--base-3); }

.entry-header, .entry-content:not(:first-child), .featured-image + .entry-header { margin-top: 2em; }
.inside-article > :first-child { margin-top: 0; }
.entry-title { margin-bottom: 0; }

.entry-content > :last-child { margin-bottom: 0; }
.entry-content > [class*="wp-block-"]:not(:last-child) { margin-bottom: 1.5em; }

/* Pages (hors accueil) : colonne de lecture centrée, comme l'ancien site */
.page.no-sidebar:not(.home) .site-content { max-width: 900px; }

/* Sections pleine largeur (alignfull) */
.no-sidebar .entry-content .alignfull {
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	max-width: 100vw;
	width: auto;
}
.entry-content .alignwide,
.right-sidebar .entry-content .alignfull {
	margin-left: -40px;
	margin-right: -40px;
	width: calc(100% + 80px);
	max-width: calc(100% + 80px);
}
.wp-block-group__inner-container { max-width: var(--container); margin-left: auto; margin-right: auto; }

.alignleft { float: left; margin-right: 1.5em; }
.alignright { float: right; margin-left: 1.5em; }
.aligncenter { clear: both; display: block; margin: 0 auto; }
.entry-content::after { content: ""; display: table; clear: both; }
.wp-caption-text, figcaption { font-size: 75%; padding-top: 5px; opacity: .8; }

/* Image à la une (article) */
.featured-image { text-align: center; line-height: 0; }
.featured-image img {
	border-radius: 10px;
	box-shadow: 0 0 16px 9px rgb(0 0 0 / 19%);
}

/* Barre grise « On vous aide à trouver votre école » sous l'image */
.post-cta {
	background-color: var(--base-2);
	text-align: center;
	padding: 10px 20px 15px;
}
.post-cta .cta-form { display: flex; justify-content: center; }

.post-meta { font-size: 85%; color: var(--contrast-2); }
.post-meta a { color: var(--contrast-2); }
.post-meta .sep { margin: 0 4px; }

.archive-description { margin-bottom: 2em; color: var(--contrast-2); }

/* Commentaires */
.comments-area { margin-top: 20px; }
.comment-list { list-style: none; margin: 0 0 2em; }
.comment-list .children { list-style: none; }
.comment-body { padding: 15px 0; border-bottom: 1px solid var(--base); }
.comment-author img { border-radius: 50%; vertical-align: middle; margin-right: 10px; }
.comment-metadata { font-size: 85%; }
.comment-form label { display: block; }
.comment-form input:not([type="submit"]):not([type="checkbox"]), .comment-form textarea { width: 100%; }

/* =========================================================================
   Barre latérale (remplace l'Element GP Premium d'origine)
   ========================================================================= */
.sidebar-cta {
	margin-bottom: 50px;
	padding: 50px 20px;
	border-radius: 10px;
	text-align: center;
	background-color: var(--primary2);
	background-repeat: no-repeat;
	background-position: center center;
	background-size: cover;
}
.sidebar-cta-title {
	margin-bottom: 1.5em;
	font-size: 26px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--base-3);
}
.sidebar-cta .cta-form { display: flex; justify-content: center; }

.sidebar-links { margin-bottom: 50px; font-size: 12px; }
.posts-list { list-style: none; margin: 0; padding: 0; }
.posts-list li { margin-bottom: 8px; line-height: 1.4; }
.posts-list a { color: var(--contrast); text-decoration: none; }
.posts-list a:hover { color: var(--accent); text-decoration: underline; }

.sidebar .widget { margin-bottom: 30px; font-size: 15px; }
.widget-title { font-size: 20px; margin-bottom: 15px; }
.sidebar .widget ul { list-style: none; margin: 0; }
.sidebar .widget li { margin-bottom: 8px; }

/* =========================================================================
   Grille d'articles (remplace WP Show Posts, même rendu que la liste n°16)
   ========================================================================= */
.posts-grid { display: grid; gap: 30px; margin: 0 0 1.5em; }
.posts-grid.cols-1 { grid-template-columns: 1fr; }
.posts-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.posts-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.posts-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.post-card {
	display: flex;
	flex-direction: column;
	background: var(--base-3);
	border: 1px solid #dfe9eb;
	border-radius: 3px;
	overflow: hidden;
	transition: box-shadow .2s;
}
.post-card:hover { box-shadow: 0 8px 24px rgba(0, 0, 0, .08); }
.post-card-image { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--base-2); }
.post-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.post-card:hover .post-card-image img { transform: scale(1.03); }
.post-card-body { padding: 20px 30px; }
.post-card-title { font-size: 20px; font-weight: 600; line-height: 1.3; margin: 0; }
.post-card-title a { color: #000; text-decoration: none; }
.post-card-title a:hover { color: var(--accent); }
.posts-empty { color: var(--contrast-2); }

.pagination { margin-top: 20px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.pagination .page-numbers {
	padding: 8px 14px;
	border: 1px solid #dfe9eb;
	color: var(--contrast);
	text-decoration: none;
	font-size: 15px;
}
.pagination .page-numbers.current,
.pagination a.page-numbers:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* =========================================================================
   Pied de page (remplace l'Element GP Premium)
   ========================================================================= */
.site-footer {
	margin-top: 120px;
	background-color: var(--contrast);
	color: var(--base-2);
}
.footer-inner {
	max-width: var(--container);
	margin: 0 auto;
	padding: 80px 0 50px;
}
.cta-banner {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	margin-top: -150px;
	margin-bottom: 80px;
	padding: 35px;
	border-radius: 10px;
	background-color: var(--accent);
	background-repeat: no-repeat;
	background-position: center center;
	background-size: cover;
}
.cta-banner-text { flex: 0 0 75%; font-size: 29px; font-weight: 600; line-height: 1.3; color: var(--base-3); }
.cta-banner-action { flex: 0 0 25%; display: flex; justify-content: center; }
.cta-banner form { margin: 0; }
.footer-links { text-align: right; color: var(--base-2); font-size: 17px; }
.footer-links a { color: var(--base-2); }
.footer-links a:hover { color: #fff; }

/* =========================================================================
   Styles repris du « CSS additionnel » de GeneratePress
   (lié à l'ancien thème : il ne suit pas le changement de thème)
   ========================================================================= */
.alire { background-color: #f5f8fa; padding: 25px; font-weight: bold; }
.alire a { font-weight: normal; }

#ez-toc-container {
	padding: 50px;
	margin-bottom: 45px;
	box-shadow: 0 3px 55px 0 rgb(0 1 1 / 10%);
}
#ez-toc-container .ez-toc-title {
	display: block;
	text-align: center;
	font-size: 24px;
	font-weight: 700;
	margin: 0;
	padding-bottom: 20px;
}
#ez-toc-container ul { list-style: none; line-height: 2em; }

.ombre {
	padding: 40px;
	border-radius: 10px;
	box-shadow: 0 0 16px 0 rgb(0 0 0 / 7%);
}

.cta-lien .wp-block-button__link,
.wp-block-button.cta-lien .wp-block-button__link {
	background: #fff !important;
	color: var(--accent) !important;
	box-shadow: 0 0 20px rgb(0 0 0 / 6%);
	font-size: 15px;
}

.wp-block-buttons.cta,
.gb-container .gb-container-7ad3f729 {
	display: flex !important;
	gap: .5em !important;
	flex-wrap: wrap !important;
	align-items: center !important;
	justify-content: center !important;
}
.gb-container .gb-container-home {
	display: flex !important;
	gap: .5em !important;
	flex-wrap: wrap !important;
	justify-content: flex-start !important;
}
.wp-block-buttons form { margin: 0; }

/* Bouton bleu « Trouvez votre future école » (formulaire) */
.gb-button-wrapper-620e5f7d0614e,
button.gb-button-wrapper-620e5f7d0614e {
	background-color: var(--btn);
	color: #fff;
	padding: 15px 20px;
	display: inline-flex;
	align-items: center;
	font-weight: 600;
	font-size: large;
	border: 0;
	line-height: 1.2;
	text-transform: uppercase;
}
button.gb-button-wrapper-620e5f7d0614e:hover { background-color: #0256b8; color: #fff; }

.gb-button-wrapper-620 {
	background-color: transparent;
	color: var(--contrast-2);
	padding: 10px 15px;
	display: inline-flex;
	align-items: center;
	font-size: 24px;
	font-weight: 600;
}
button.gb-button-wrapper-620:hover { background-color: transparent; color: var(--contrast-2); }

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 1024px) {
	.posts-grid.cols-3, .posts-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.page-hero-title { font-size: 46px; }
}

@media (max-width: 1240px) {
	.footer-inner { padding-left: 20px; padding-right: 20px; }
}

@media (max-width: 768px) {
	.inside-header { flex-wrap: wrap; padding: 15px 30px; }

	/* Une seule colonne */
	.site-content { display: block; }
	.right-sidebar .content-area, .widget-area { width: 100%; }
	.site-main, .right-sidebar .site-main { margin: 20px 0; }
	.inside-article { padding: 30px; }
	.inside-right-sidebar { margin: 0; padding: 0 30px 20px; }
	.entry-content .alignwide,
	.right-sidebar .entry-content .alignfull { margin-left: -30px; margin-right: -30px; width: calc(100% + 60px); max-width: calc(100% + 60px); }

	.page-hero-inner { padding: 50px 20px 110px; }
	.page-hero-title { font-size: 32px; }
	.page-hero-shape svg { height: 50px; }

	.sidebar-cta-title { font-size: 22px; }
	.gb-button-wrapper-620 { font-size: 18px; }

	h1 { font-size: 31px; }
	h2 { font-size: 27px; }
	h3 { font-size: 24px; }

	/* Menu mobile */
	.menu-toggle {
		display: block;
		margin-left: auto;
		width: 48px; height: 48px;
		padding: 12px;
		background: rgba(0, 0, 0, .02);
		border: 0;
	}
	.menu-toggle:hover { background: rgba(0, 0, 0, .05); }
	.menu-toggle-bars,
	.menu-toggle-bars::before,
	.menu-toggle-bars::after {
		display: block;
		width: 22px; height: 2px;
		background: var(--contrast);
		position: relative;
		transition: .2s;
	}
	.menu-toggle-bars::before, .menu-toggle-bars::after { content: ""; position: absolute; left: 0; }
	.menu-toggle-bars::before { top: -7px; }
	.menu-toggle-bars::after { top: 7px; }
	.menu-toggle[aria-expanded="true"] .menu-toggle-bars { background: transparent; }
	.menu-toggle[aria-expanded="true"] .menu-toggle-bars::before { top: 0; transform: rotate(45deg); }
	.menu-toggle[aria-expanded="true"] .menu-toggle-bars::after { top: 0; transform: rotate(-45deg); }

	.main-navigation { display: none; flex-basis: 100%; }
	.main-navigation.is-open { display: block; }
	.main-navigation > ul { display: block; padding: 10px 0; }
	.main-navigation a { line-height: 1.4; padding: 12px 44px 12px 0; }
	.main-navigation .sub-menu {
		position: static;
		width: auto;
		opacity: 1; visibility: visible; pointer-events: auto;
		box-shadow: none;
		display: none;
		padding-left: 15px;
	}
	.main-navigation li.is-open > .sub-menu { display: block; }
	.submenu-toggle {
		display: block;
		position: absolute;
		top: 2px; right: 0;
		width: 40px; height: 40px;
		padding: 0;
		background: none;
		border: 0;
	}
	.submenu-toggle:hover { background: none; }
	.submenu-toggle::after {
		content: "";
		display: block;
		width: 8px; height: 8px;
		margin: auto;
		border-right: 2px solid var(--contrast);
		border-bottom: 2px solid var(--contrast);
		transform: rotate(45deg);
		transition: .2s;
	}
	.is-open > .submenu-toggle::after { transform: rotate(-135deg); }

	.posts-grid.cols-2, .posts-grid.cols-3, .posts-grid.cols-4 { grid-template-columns: 1fr; }

	.cta-banner { margin-left: 0; margin-right: 0; }
	.cta-banner-text, .cta-banner-action { flex-basis: 100%; }
	.cta-banner-text { font-size: 24px; margin-bottom: 20px; }
	.cta-banner-action { justify-content: flex-start; }
	.footer-links { text-align: center; }

	.ombre { padding: 30px; }
}
