/*
Theme Name: E-CONNEX Systems
Description: Thème sur mesure, léger et accessible, pour E-CONNEX SYSTEMS (blocs natifs WordPress, sans constructeur de pages).
Version: 1.0.0
Requires at least: 6.6
Requires PHP: 8.1
Text Domain: econnex-systems
License: GPL-2.0-or-later
*/

:root {
  --ec-radius: 14px;
  --ec-shadow: 0 1px 2px rgba(11, 22, 38, .06), 0 8px 24px rgba(11, 22, 38, .06);
  --ec-shadow-hover: 0 2px 4px rgba(11, 22, 38, .08), 0 16px 40px rgba(26, 79, 214, .14);
}

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
body { -webkit-font-smoothing: antialiased; overflow-x: hidden; }
.wp-site-blocks > * { margin-block-start: 0; }

/* Focus visible */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--wp--preset--color--primary);
  outline-offset: 3px;
  border-radius: 4px;
}
.ec-dark :where(a, button):focus-visible { outline-color: var(--wp--preset--color--cyan); }

/* Lien d'évitement */
.ec-skip { position: absolute; left: -9999px; top: 0; z-index: 1000; background: var(--wp--preset--color--ink); color: #fff; padding: .75rem 1rem; border-radius: 0 0 8px 0; }
.ec-skip:focus { left: 0; }

/* ---------- En-tête ---------- */
.ec-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--wp--preset--color--line);
}
.admin-bar .ec-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .ec-header { top: 46px; } }
.ec-header__inner { min-height: 72px; }
.ec-logo { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--wp--preset--color--ink); font-weight: 800; letter-spacing: .02em; font-size: 1.15rem; line-height: 1; }
.ec-logo:hover { color: var(--wp--preset--color--ink); }
.ec-logo__mark { width: 34px; height: 34px; flex: none; }
.ec-logo__txt span { color: var(--wp--preset--color--primary); }
.ec-header .wp-block-navigation { font-weight: 600; font-size: .98rem; gap: 1.6rem; }
.ec-header .wp-block-navigation a { color: var(--wp--preset--color--ink); text-decoration: none; }
.ec-header .wp-block-navigation a:hover,
.ec-header .wp-block-navigation .current-menu-item > a { color: var(--wp--preset--color--primary); }
.ec-header .wp-block-navigation-item.ec-nav-cta > a {
  background: var(--wp--preset--color--primary); color: #fff; padding: .6rem 1.1rem; border-radius: 10px;
}
.ec-header .wp-block-navigation-item.ec-nav-cta > a:hover { background: var(--wp--preset--color--primary-dark); color: #fff; }
.wp-block-navigation__responsive-container.is-menu-open { padding: 1.5rem; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content { gap: 1.25rem; font-size: 1.2rem; }
.wp-block-navigation__responsive-container-open, .wp-block-navigation__responsive-container-close { min-width: 44px; min-height: 44px; justify-content: center; }

/* ---------- Sections ---------- */
.ec-section { padding-top: clamp(3.5rem, 8vw, 6rem) !important; padding-bottom: clamp(3.5rem, 8vw, 6rem) !important; }
.ec-soft { background: var(--wp--preset--color--soft); }
.ec-eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .8rem !important; font-weight: 700; color: var(--wp--preset--color--primary); margin-bottom: .5rem !important; }
.ec-dark .ec-eyebrow { color: var(--wp--preset--color--cyan); }
.ec-lead { font-size: 1.2rem; color: var(--wp--preset--color--muted); }
:where(.ec-section, .ec-hero, .ec-cta, .ec-universe) > .ec-lead { max-width: 46rem; margin-left: 0 !important; }
.ec-center { text-align: center; }
.ec-center .ec-lead { margin-left: auto !important; margin-right: auto; }

/* Fond sombre "réseau" */
.ec-dark {
  position: relative; isolation: isolate; color: #e6edf7;
  background:
    radial-gradient(ellipse 60% 70% at 85% 10%, rgba(47, 212, 232, .18), transparent 60%),
    radial-gradient(ellipse 50% 60% at 10% 100%, rgba(26, 79, 214, .35), transparent 60%),
    var(--wp--preset--color--ink);
}
.ec-dark::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 70% 30%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 80% at 70% 30%, #000 30%, transparent 75%);
}
.ec-dark :where(h1, h2, h3, h4) { color: #fff; }
.ec-dark .ec-lead, .ec-dark p { color: #c9d5e6; }
.ec-dark a:not(.wp-element-button) { color: #fff; }

/* Héros */
.ec-hero { padding-top: clamp(4rem, 10vw, 7.5rem) !important; padding-bottom: clamp(4rem, 10vw, 7.5rem) !important; }
.ec-hero h1 { max-width: 18em; font-size: var(--wp--preset--font-size--xx-large); }
.ec-hero h1 em { font-style: normal; background: linear-gradient(90deg, #7fb2ff, var(--wp--preset--color--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ec-hero .ec-lead { font-size: clamp(1.1rem, 2vw, 1.3rem); }
.ec-btn-ghost .wp-block-button__link { background: transparent !important; color: #fff !important; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .45); }
.ec-btn-ghost .wp-block-button__link:hover { box-shadow: inset 0 0 0 2px #fff; }
.ec-btn-outline .wp-block-button__link { background: transparent !important; color: var(--wp--preset--color--primary) !important; box-shadow: inset 0 0 0 2px var(--wp--preset--color--primary); }
.ec-btn-outline .wp-block-button__link:hover { background: var(--wp--preset--color--primary) !important; color: #fff !important; }

/* Liste de piliers du héros */
.ec-pills { list-style: none; padding: 0 !important; margin-top: 2.5rem !important; display: flex; flex-wrap: wrap; gap: .6rem; }
.ec-pills li { padding: .45rem .9rem; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .05); font-size: .92rem; color: #dbe6f5; }

/* En-tête de page intérieure */
.ec-pagehead { padding-top: clamp(3rem, 7vw, 5rem) !important; padding-bottom: clamp(3rem, 7vw, 5rem) !important; }
.ec-pagehead h1 { margin-top: .25rem; }
.ec-pagehead .wp-block-post-excerpt__excerpt { font-size: 1.2rem; color: #c9d5e6; max-width: 44rem; margin: 0; }
.ec-back { font-size: .95rem; font-weight: 600; }
.ec-back a { text-decoration: none; }
.ec-back a:hover { text-decoration: underline; }

/* ---------- Cartes ---------- */
.ec-grid { gap: 1.25rem !important; }
.ec-card {
  position: relative; background: #fff; border: 1px solid var(--wp--preset--color--line);
  border-radius: var(--ec-radius); padding: 1.6rem !important; box-shadow: var(--ec-shadow);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.ec-card h3 { margin: 0 0 .5rem; font-size: 1.15rem; }
.ec-card p { margin: 0; color: var(--wp--preset--color--muted); font-size: .98rem; }
.ec-card h3 a { color: var(--wp--preset--color--ink); text-decoration: none; }
.ec-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--ec-radius); }
.ec-card:has(h3 a):hover { transform: translateY(-3px); box-shadow: var(--ec-shadow-hover); border-color: #b9c9ea; }
.ec-card:has(h3 a):hover h3 a { color: var(--wp--preset--color--primary); }
.ec-card:has(h3 a:focus-visible) { outline: 3px solid var(--wp--preset--color--primary); outline-offset: 3px; }
.ec-card h3 a:focus-visible { outline: none; }
.ec-card .ec-more { margin-top: 1rem; font-weight: 650; color: var(--wp--preset--color--primary); font-size: .95rem; }

/* Icônes (SVG en masque, couleur pilotée par CSS) */
.ico::before {
  content: ""; display: block; width: 48px; height: 48px; margin-bottom: 1.1rem; border-radius: 12px;
  background: linear-gradient(135deg, var(--wp--preset--color--primary), #2c8cf0) ;
  -webkit-mask: var(--ico) center / 26px 26px no-repeat, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask: var(--ico) center / 26px 26px no-repeat exclude, linear-gradient(#000 0 0);
}
.ico-securite { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l7 3v6c0 4.5-3 7.6-7 9-4-1.4-7-4.5-7-9V6z'/%3E%3Cpath d='M9 12l2 2 4-4'/%3E%3C/svg%3E"); }
.ico-acces { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='6' y='3' width='12' height='18' rx='2'/%3E%3Ccircle cx='12' cy='9' r='2.5'/%3E%3Cpath d='M9 16h6'/%3E%3C/svg%3E"); }
.ico-telephonie { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 4h4l2 5-2.5 1.5a11 11 0 0 0 5 5L15 13l5 2v4a2 2 0 0 1-2 2A16 16 0 0 1 3 6a2 2 0 0 1 2-2z'/%3E%3C/svg%3E"); }
.ico-reseaux { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 9a15 15 0 0 1 20 0'/%3E%3Cpath d='M5 12.5a10 10 0 0 1 14 0'/%3E%3Cpath d='M8.5 16a5 5 0 0 1 7 0'/%3E%3Cpath d='M12 20h.01'/%3E%3C/svg%3E"); }
.ico-informatique { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='4' width='16' height='11' rx='2'/%3E%3Cpath d='M2 20h20'/%3E%3C/svg%3E"); }
.ico-serveurs { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='7' rx='2'/%3E%3Crect x='3' y='14' width='18' height='7' rx='2'/%3E%3Cpath d='M7 6.5h.01M7 17.5h.01'/%3E%3C/svg%3E"); }
.ico-cyber { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3Cpath d='M12 15v2'/%3E%3C/svg%3E"); }
.ico-collab { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8' r='3'/%3E%3Cpath d='M3 20a6 6 0 0 1 12 0'/%3E%3Cpath d='M16 5a3 3 0 0 1 0 6'/%3E%3Cpath d='M18 14.5c1.8.8 3 2.8 3 5.5'/%3E%3C/svg%3E"); }
.ico-tv { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='7' width='18' height='12' rx='2'/%3E%3Cpath d='M8 3l4 4 4-4'/%3E%3C/svg%3E"); }
.ico-av { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='7' width='13' height='10' rx='2'/%3E%3Cpath d='M15 10.5l6-3.5v10l-6-3.5'/%3E%3C/svg%3E"); }
.ico-batiment { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 11l9-7 9 7v9a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1z'/%3E%3Cpath d='M9.5 15a3.5 3.5 0 0 1 5 0'/%3E%3Cpath d='M12 18h.01'/%3E%3C/svg%3E"); }
.ico-sante { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20s-7.5-4.6-9-9.5A4.8 4.8 0 0 1 12 6.6a4.8 4.8 0 0 1 9 3.9C19.5 15.4 12 20 12 20z'/%3E%3Cpath d='M12 10v5M9.5 12.5h5'/%3E%3C/svg%3E"); }
.ico-electricite { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13 2L4 14h7l-1 8 9-12h-7z'/%3E%3C/svg%3E"); }
.ico-accompagnement { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='4' width='14' height='17' rx='2'/%3E%3Cpath d='M9 2h6v4H9z'/%3E%3Cpath d='M9 13l2 2 4-4'/%3E%3C/svg%3E"); }
.ico-financement { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='5' width='20' height='14' rx='2'/%3E%3Cpath d='M2 10h20'/%3E%3Cpath d='M6 15h4'/%3E%3C/svg%3E"); }
.ico-mail { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='M3 7l9 6 9-6'/%3E%3C/svg%3E"); }

/* Univers (page Services) */
.ec-universe { margin-top: 3.5rem !important; }
.ec-universe:first-child { margin-top: 0 !important; }
.ec-universe > h2 { display: flex; align-items: center; gap: .75rem; }
.ec-universe > h2::before { content: ""; width: 28px; height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--wp--preset--color--primary), var(--wp--preset--color--cyan)); }

/* Étapes */
.ec-steps { counter-reset: step; gap: 1rem !important; }
.ec-step { counter-increment: step; position: relative; padding: 1.5rem 1.4rem 1.4rem !important; border-radius: var(--ec-radius); background: #fff; border: 1px solid var(--wp--preset--color--line); }
.ec-step::before { content: counter(step, decimal-leading-zero); display: block; font-weight: 800; font-size: 1.6rem; line-height: 1; margin-bottom: .8rem; color: var(--wp--preset--color--primary); }
.ec-step h3 { font-size: 1.05rem; margin: 0 0 .4rem; }
.ec-step p { margin: 0; font-size: .95rem; color: var(--wp--preset--color--muted); }
.ec-dark .ec-step { background: rgba(255, 255, 255, .04); border-color: rgba(255, 255, 255, .12); }
.ec-dark .ec-step::before { color: var(--wp--preset--color--cyan); }
.ec-dark .ec-step p { color: #b9c6d9; }

/* Liste à coches */
.ec-checklist { list-style: none; padding: 0 !important; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: .75rem 1.25rem; }
.ec-checklist li { position: relative; padding: 1rem 1rem 1rem 3rem; background: #fff; border: 1px solid var(--wp--preset--color--line); border-radius: 12px; }
.ec-checklist li::before {
  content: ""; position: absolute; left: 1rem; top: 1.15rem; width: 20px; height: 20px; 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 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12l4 4 8-8'/%3E%3C/svg%3E") center / 13px no-repeat;
}
.ec-checklist li strong { display: block; color: var(--wp--preset--color--ink); }
.ec-checklist li { color: var(--wp--preset--color--muted); font-size: .97rem; }

/* Publics */
.ec-audience { gap: 1rem !important; }
.ec-audience > * { border-left: 3px solid var(--wp--preset--color--primary); padding: .25rem 0 .25rem 1.1rem !important; }
.ec-audience h3 { font-size: 1.05rem; margin: 0 0 .35rem; }
.ec-audience p { margin: 0; color: var(--wp--preset--color--muted); font-size: .96rem; }

/* Bandeau d'appel à l'action */
.ec-cta { border-radius: 22px; padding: clamp(2rem, 5vw, 3.5rem) !important; overflow: hidden; }
.ec-cta h2 { margin-top: 0; }

/* Liens liés */
.ec-related { display: flex; flex-wrap: wrap; gap: .6rem; list-style: none; padding: 0 !important; }
.ec-related a { display: inline-block; padding: .5rem .95rem; border-radius: 999px; border: 1px solid var(--wp--preset--color--line); text-decoration: none; font-weight: 600; font-size: .95rem; background: #fff; }
.ec-related a:hover { border-color: var(--wp--preset--color--primary); }

/* Pages légales */
.ec-legal h2 { font-size: 1.35rem; margin-top: 2.5rem; }
.ec-todo { background: #fff7e6; border: 1px solid #f3c96b; border-radius: 10px; padding: 1rem 1.2rem !important; color: #5c4300; }
.ec-legal table { font-size: .95rem; }
.ec-legal .wp-block-table { overflow-x: auto; }

/* Contact */
.ec-contact-card { text-align: left; }
.ec-contact-card .wp-block-buttons { margin-top: 1.25rem; }

/* ---------- Pied de page ---------- */
.ec-footer { font-size: .95rem; }
.ec-footer h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .14em; color: #8fa3bf !important; margin: 0 0 1rem; }
.ec-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.ec-footer a { text-decoration: none; color: #dbe6f5 !important; display: inline-block; padding: 2px 0; }
.ec-footer a:hover { color: #fff !important; text-decoration: underline; }
.ec-footer .ec-logo { color: #fff; }
.ec-footer .ec-logo__txt span { color: var(--wp--preset--color--cyan); }
.ec-footer__bottom { border-top: 1px solid rgba(255, 255, 255, .12); margin-top: 3rem !important; padding-top: 1.5rem !important; font-size: .88rem; }
.ec-footer__bottom p { color: #8fa3bf !important; margin: 0; }

/* 404 */
.ec-404 .ec-code { font-size: clamp(4rem, 14vw, 8rem); font-weight: 800; line-height: 1; margin: 0; background: linear-gradient(90deg, #7fb2ff, var(--wp--preset--color--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; }

@media (max-width: 600px) {
  .ec-hero .wp-block-buttons { flex-direction: column; align-items: stretch; }
  .ec-hero .wp-block-button__link { width: 100%; text-align: center; }
}
