/*
Theme Name: Fondation 2026
Theme URI: https://fondationlamaintendue.cm/
Author: Fondation La Main Tendue
Description: Thème bloc sur mesure, moderne et épuré, aux couleurs du logo de la Fondation La Main Tendue (turquoise, rouge, noir).
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: fondation-2026
*/

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
:where(img) { height: auto; }
::selection { background: var(--wp--preset--color--primary); color: #fff; }
:focus-visible { outline: 2px solid var(--wp--preset--color--primary); outline-offset: 3px; border-radius: 4px; }

/* ---------- En-tête ---------- */
.wp-site-blocks > header.wp-block-template-part { position: sticky; top: 0; z-index: 50; }
.admin-bar .wp-site-blocks > header.wp-block-template-part { top: 32px; }
@media (max-width: 782px) { .admin-bar .wp-site-blocks > header.wp-block-template-part { top: 46px; } }
@media (max-width: 600px) { .admin-bar .wp-site-blocks > header.wp-block-template-part { top: 0; } }
/* Le flou est porté par un pseudo-élément : un backdrop-filter sur l'en-tête lui-même enfermerait le menu mobile (position fixe) dans sa hauteur. */
.fmt-header { position: relative; isolation: isolate; border-bottom: 1px solid var(--wp--preset--color--line); }
.fmt-header::before { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(255,255,255,.94); backdrop-filter: saturate(160%) blur(10px); -webkit-backdrop-filter: saturate(160%) blur(10px); }
.fmt-brand { gap: .75rem; }
.fmt-brand .wp-block-site-title { line-height: 1.1; max-width: 12ch; }
.fmt-brand .wp-block-site-title a { text-decoration: none; }
.fmt-header .wp-block-navigation a { text-decoration: none; }
.fmt-header .wp-block-navigation .wp-block-navigation-item__content:hover { color: var(--wp--preset--color--primary-dark); }
.fmt-header .wp-block-navigation .current-menu-item > .wp-block-navigation-item__content { color: var(--wp--preset--color--primary-dark); }

@media (max-width: 781px) { .wp-block-buttons.fmt-header-cta { display: none !important; } .fmt-brand .wp-block-site-title { font-size: .85rem; } }
.fmt-brand .wp-block-site-logo { flex: none; }
.fmt-header .wp-block-button__link { white-space: nowrap; }
@media (min-width: 961px) { .fmt-header .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content { white-space: nowrap; } }
/* Écrans intermédiaires : on retire le bouton (Contacts reste dans le menu) et on resserre le menu. */
@media (max-width: 1180px) { .wp-block-buttons.fmt-header-cta { display: none !important; } }
@media (min-width: 600px) and (max-width: 1080px) { .fmt-header .wp-block-navigation { font-size: .9rem; } .fmt-header .wp-block-navigation .wp-block-navigation__container { gap: 1.05rem; } }
/* Tablettes : menu repliable (bouton hamburger) au lieu d'un menu sur deux lignes. */
@media (min-width: 600px) and (max-width: 960px) {
	.fmt-header .wp-block-navigation__responsive-container-open:not(.always-shown) { display: flex; }
	.fmt-header .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) { display: none; }
}
/* Menu mobile ouvert : aligné à gauche, plus lisible. */
.fmt-header .wp-block-navigation__responsive-container.is-menu-open { padding: 1.25rem 1.5rem 2rem; }
.fmt-header .is-menu-open .wp-block-navigation__container, .fmt-header .is-menu-open .wp-block-navigation-item { --navigation-layout-justification-setting: flex-start; --navigation-layout-justify: flex-start; text-align: left; }
.fmt-header .is-menu-open .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content { font-size: 1.15rem; font-weight: 700; }
.fmt-header .is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item__content { color: var(--wp--preset--color--muted); }
.fmt-footer .wp-block-site-title a { color: #fff; }
.fmt-footer .wp-block-navigation a { color: #E6ECEF; }

/* ---------- Typographie d'appoint ---------- */
.fmt-eyebrow { display: inline-flex; align-items: center; gap: .55rem; text-transform: uppercase; letter-spacing: .14em; font-weight: 700; font-size: .78rem; color: var(--wp--preset--color--primary-dark); }
.fmt-eyebrow::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: var(--wp--preset--color--accent); flex: none; }
.fmt-lead { font-size: clamp(1.08rem, .98rem + .45vw, 1.3rem); line-height: 1.65; color: var(--wp--preset--color--muted); }

/* ---------- Sections ---------- */
.fmt-hero { position: relative; overflow: hidden; }
.fmt-hero::after { content: ""; position: absolute; right: -12vw; top: -12vw; width: 44vw; height: 44vw; max-width: 640px; max-height: 640px; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--wp--preset--color--primary) 16%, transparent), transparent); pointer-events: none; }
.fmt-hero > * { position: relative; z-index: 1; }
.fmt-hero-figure img { border-radius: 24px; aspect-ratio: 4 / 5; object-fit: cover; width: 100%; }
.fmt-card { height: 100%; border: 1px solid var(--wp--preset--color--line); border-radius: 18px; background: #fff; transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease; }
.fmt-card:hover { border-color: color-mix(in srgb, var(--wp--preset--color--primary) 45%, transparent); transform: translateY(-2px); box-shadow: 0 14px 40px -24px rgba(16, 64, 72, .35); }
.fmt-card .fmt-num { font-weight: 800; color: var(--wp--preset--color--primary); font-size: .9rem; letter-spacing: .08em; }
.fmt-stat { border-left: 3px solid var(--wp--preset--color--accent); padding-left: 1rem; }

/* ---------- Articles ---------- */
.fmt-post-card .wp-block-post-featured-image img { border-radius: 14px; aspect-ratio: 16 / 10; object-fit: cover; }
.fmt-post-card .wp-block-post-title a { text-decoration: none; color: var(--wp--preset--color--ink); }
.fmt-post-card .wp-block-post-title a:hover { color: var(--wp--preset--color--primary-dark); }
.fmt-meta { color: var(--wp--preset--color--muted); font-size: .85rem; }
.wp-block-post-content > * + h2 { margin-top: 2.2em; }

/* ---------- Boutons ---------- */
.wp-element-button, .wp-block-button__link { transition: background-color .2s ease, color .2s ease, border-color .2s ease; }
.is-style-outline > .wp-block-button__link { border: 1.5px solid currentColor; }

/* ---------- Contenus Elementor hérités ---------- */
.fmt-legacy .elementor-section.elementor-section-boxed > .elementor-container { max-width: var(--wp--style--global--wide-size); }
/* Boutons Elementor sans couleur propre : couleurs de la charte au lieu du gris par défaut. */
body .elementor-button { background-color: var(--wp--preset--color--primary-dark); }
body .elementor-button:hover, body .elementor-button:focus { background-color: var(--wp--preset--color--ink); }

/* ---------- Pied de page ---------- */
.fmt-footer a { text-decoration: none; }
.fmt-footer a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .fmt-card { transition: none; } .fmt-card:hover { transform: none; } }

/* ---------- Accueil ---------- */
.fmt-hl { color: var(--wp--preset--color--primary-dark); }
.fmt-hero-media { position: relative; }
.fmt-hero-figure { margin: 0; }
.fmt-hero-figure img { border-radius: 28px; aspect-ratio: 4 / 5; object-fit: cover; object-position: center 30%; width: 100%; display: block; }
.fmt-hero-media::before { content: ""; position: absolute; inset: auto -18px -18px auto; width: 62%; height: 62%; border-radius: 28px; background: var(--wp--preset--color--soft); z-index: -1; }
.fmt-badge { position: absolute; left: -1.25rem; bottom: 1.75rem; background: #fff; border-radius: 14px; padding: .85rem 1.1rem; box-shadow: 0 18px 40px -22px rgba(13, 60, 68, .45); border-left: 4px solid var(--wp--preset--color--accent); font-size: .9rem; line-height: 1.45; }
.fmt-badge p { margin: 0; }
@media (max-width: 781px) { .fmt-badge { left: .75rem; bottom: .75rem; } .fmt-hero-media::before { inset: auto -8px -8px auto; } }
.fmt-more a { font-weight: 700; text-decoration: none; color: var(--wp--preset--color--primary-dark); }
.fmt-more a::after { content: " \2192"; transition: margin .2s ease; }
.fmt-more a:hover { color: var(--wp--preset--color--accent); }
.fmt-checks { list-style: none; padding-left: 0; margin: 0; }
.fmt-checks li { position: relative; padding: .85rem 0 .85rem 2.1rem; border-bottom: 1px solid var(--wp--preset--color--line); }
.fmt-checks li:last-child { border-bottom: 0; }
.fmt-checks li::before { content: ""; position: absolute; left: 0; top: 1.15rem; width: 1.15rem; height: 1.15rem; border-radius: 50%; background: var(--wp--preset--color--primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M4 8.4l2.6 2.5L12 5.3'/%3E%3C/svg%3E") center / 72% no-repeat; }
.fmt-gallery .wp-block-image { margin: 0; }
.fmt-gallery img { border-radius: 16px; aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.fmt-gallery figcaption { margin-top: .6rem; text-align: left; }
.fmt-grid-5 .fmt-card h3 { margin-top: .2rem; }

/* ---------- Pied de page (détails) ---------- */
.fmt-brand-footer .wp-block-site-logo img { background: #fff; border-radius: 50%; padding: 3px; }
.fmt-brand-footer .wp-block-site-title a { color: #fff; }
.fmt-foot-title { text-transform: uppercase; letter-spacing: .14em; font-size: .74rem; font-weight: 700; color: #8ADBE6; margin-bottom: .6rem; }
.fmt-foot-links { list-style: none; padding: 0; margin: 0; font-size: .95rem; line-height: 2; }
.fmt-foot-links a { color: #E6ECEF; }
