/**
 * Global styles for Choisir Ma Creche v2.
 *
 * Handles styles that theme.json cannot express:
 * icon font, transitions, accessibility, print, etc.
 *
 * Design tokens (colors, fonts, spacing) are managed in theme.json.
 */

/* ──────────────────────────────────────────────
   Icon font
   ────────────────────────────────────────────── */

@font-face {
	font-family: "icon";
	src:
		url("../fonts/cmcicons/icomoon.woff") format("woff"),
		url("../fonts/cmcicons/icomoon.ttf") format("truetype");
	font-weight: normal;
	font-style: normal;
	font-display: swap;
}

.icon {
	font-family: "icon";
	font-weight: 400;
	-moz-osx-font-smoothing: grayscale;
	-webkit-font-smoothing: antialiased;
	display: inline-block;
	font-style: normal;
	font-variant: normal;
	text-rendering: auto;
	line-height: 1;
}

[class^="icon-"],
[class*=" icon-"] {
	font-family: "icon" !important;
	speak: never;
	font-style: normal;
	font-weight: normal;
	font-variant: normal;
	text-transform: none;
	line-height: 1;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* Icon glyphs */
.icon-triangle-top::before {
	content: "\e918";
}
.icon-close::before {
	content: "\e919";
}
.icon-angle-down::before {
	content: "\e914";
}
.icon-angle-left::before {
	content: "\e915";
}
.icon-angle-right::before {
	content: "\e916";
}
.icon-angle-up::before {
	content: "\e917";
}
.icon-hexagon::before {
	content: "\e91a";
}
.icon-left-arrow::before {
	content: "\e900";
}
.icon-right-arrow::before {
	content: "\e901";
}
.icon-search::before {
	content: "\e902";
}
.icon-filter::before {
	content: "\e903";
}
.icon-phone::before {
	content: "\e904";
}
.icon-call-back::before {
	content: "\e905";
}
.icon-call::before {
	content: "\e906";
}
.icon-enveloppe::before {
	content: "\e907";
}
.icon-chat-validate::before {
	content: "\e908";
}
.icon-paper-plane::before {
	content: "\e909";
}
.icon-paper-plane-flying::before {
	content: "\e90a";
}
.icon-star::before {
	content: "\e90b";
}
.icon-love::before {
	content: "\e90c";
}
.icon-map-marker::before {
	content: "\e90d";
}
.icon-play-circle::before {
	content: "\e90e";
}
.icon-expand::before {
	content: "\e90f";
}
.icon-bulb::before {
	content: "\e910";
}
.icon-calculator::before {
	content: "\e911";
}
.icon-book::before {
	content: "\e912";
}
.icon-book-star::before {
	content: "\e913";
}
.icon-google::before {
	content: "\ea88";
}
.icon-google2::before {
	content: "\ea89";
}
.icon-google3::before {
	content: "\ea8a";
}
.icon-facebook::before {
	content: "\ea90";
}
.icon-facebook2::before {
	content: "\ea91";
}
.icon-instagram::before {
	content: "\ea92";
}
.icon-whatsapp::before {
	content: "\ea93";
}
.icon-twitter::before {
	content: "\ea96";
}
.icon-youtube::before {
	content: "\ea9d";
}
.icon-vimeo::before {
	content: "\eaa0";
}
.icon-vimeo2::before {
	content: "\eaa1";
}
.icon-linkedin::before {
	content: "\eac9";
}
.icon-linkedin2::before {
	content: "\eaca";
}
.icon-pinterest::before {
	content: "\ead1";
}
.icon-pinterest2::before {
	content: "\ead2";
}

/* ──────────────────────────────────────────────
   Base / reset
   ────────────────────────────────────────────── */

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

html {
	font-size: 16px;
}

img {
	max-width: 100%;
	height: auto;
}

.header-menu-logo {
	position: relative;
	z-index: 30;
}

/* ──────────────────────────────────────────────
   Content typography
   ────────────────────────────────────────────── */

.wp-block-post-content p,
.wp-block-post-content ul {
	color: var(--wp--preset--color--text-muted);
	font-size: 1rem;
	line-height: 1.6;
	font-family: var(--wp--preset--font-family--body);
}

.wp-block-post-content h2 {
	font-family: var(--wp--preset--font-family--body);
	font-size: 2.125rem;
	font-weight: 700;
	letter-spacing: 0;
}

.wp-block-post-content h3 {
	font-family: var(--wp--preset--font-family--body);
	font-size: 1.875rem;
	font-weight: 600;
	letter-spacing: 0;
}

.wp-block-post-content strong {
	font-weight: 600;
}

/* ──────────────────────────────────────────────
   Page backgrounds
   ────────────────────────────────────────────── */

body.home {
	background-image: url("../images/bg_homepage.png");
	background-repeat: no-repeat;
	background-position: top right;
	background-size: 100% auto;
}

body.blog,
body.page,
body.archive,
body.single-creche,
body.single-post {
	background-image: url("../images/bg_post-page.png");
	background-repeat: no-repeat;
	background-position: top right;
	background-size: 100% auto;
}

/* ──────────────────────────────────────────────
   Typography overrides
   ────────────────────────────────────────────── */

strong,
b {
	font-weight: 600;
}

/* Pre-title + heading: collapse the gap */
p.has-heading-font-family + .wp-block-heading {
	margin-top: 0;
}

/* ──────────────────────────────────────────────
   Accessibility
   ────────────────────────────────────────────── */

/* Skip link */
.skip-link {
	position: absolute;
	top: -100%;
	left: 0;
	z-index: 999;
	padding: 0.5rem 1rem;
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--white);
	font-weight: 700;
	text-decoration: none;
}

.skip-link:focus {
	top: 0;
}

/* Screen reader text */
.screen-reader-text {
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	width: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	word-wrap: normal !important;
}

.screen-reader-text:focus {
	clip: auto !important;
	clip-path: none;
	display: block;
	height: auto;
	width: auto;
	background-color: var(--wp--preset--color--pearl);
	color: var(--wp--preset--color--primary);
	font-size: 0.875rem;
	font-weight: 700;
	padding: 1rem 1.5rem;
	text-decoration: none;
	z-index: 100000;
}

/* Focus visible */
:focus-visible {
	outline: 2px solid var(--wp--preset--color--secondary);
	outline-offset: 2px;
}

/* ──────────────────────────────────────────────
   Transitions
   ────────────────────────────────────────────── */

a,
button,
input[type="submit"],
.wp-block-button__link {
	transition:
		color 0.2s ease,
		background-color 0.2s ease,
		border-color 0.2s ease,
		opacity 0.2s ease;
}

/* Fix WP specificity: .has-text-color overrides specific color classes.
   Bump specificity of preset color classes so they win. */
.has-text-color.has-white-color {
	color: var(--wp--preset--color--white) !important;
}
.has-text-color.has-primary-color {
	color: var(--wp--preset--color--primary) !important;
}
.has-text-color.has-secondary-color {
	color: var(--wp--preset--color--secondary) !important;
}
.has-text-color.has-accent-color {
	color: var(--wp--preset--color--accent) !important;
}
.has-text-color.has-text-muted-color {
	color: var(--wp--preset--color--text-muted) !important;
}

/* ──────────────────────────────────────────────
   Utilities
   ────────────────────────────────────────────── */

.text-center {
	text-align: center;
}
.text-left {
	text-align: left;
}
.text-right {
	text-align: right;
}

.visually-hidden {
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	width: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
}

/* ──────────────────────────────────────────────
   Print
   ────────────────────────────────────────────── */

@media print {
	body {
		font-size: 12pt;
		color: #000;
		background: #fff;
	}

	a[href]::after {
		content: " (" attr(href) ")";
		font-size: 0.8em;
	}

	.wp-block-navigation,
	.site-header,
	.site-footer,
	.no-print {
		display: none !important;
	}
}

.page-find-creche .cmc-find-creche-map__excerpt {
	font-family: var(--wp--preset--font-family--body);
	color: var(--wp--preset--color--text-muted);
	font-size: 1rem;
	font-weight: 400;
}

.page-find-creche .wp-block-post-title {
	font-family: var(--wp--preset--font-family--heading);
	color: var(--wp--preset--color--primary);
	font-size: 3rem;
	font-weight: 400;
}

@media (max-width: 400px) {
	.hero-inner {
		display: flex;
		flex-direction: column-reverse;
		align-items: center;
		justify-content: center;
	}
}

/* ──────────────────────────────────────────────
   Prevent horizontal overflow on mobile
   ────────────────────────────────────────────── */

html,
body {
	overflow-x: hidden;
}

/* ──────────────────────────────────────────────
   Mobile heading sizes
   ────────────────────────────────────────────── */

@media (max-width: 768px) {
	h1,
	main > .wp-block-group .wp-block-post-title,
	.has-xxxx-large-font-size {
		font-size: 2.5rem !important;
	}

	main > .wp-block-group {
		margin-top: 20px !important;
		margin-bottom: 20px !important;
	}

	.header-menu-logo {
		position: relative;
		z-index: 30;
	}
}
