/*
Theme Name: Charles-Edward
Theme URI: https://charles-edward.fr
Author: Charles-Edward Ouvril Proust
Description: Thème bloc sur mesure pour charles-edward.fr, construit sur le design system Charles-Edward (thème Nuit, Bricolage Grotesque, règle timeline). Sans page builder.
Version: 2.52.0
Requires at least: 6.6
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: charles-edward
*/

/* ---------- Base ---------- */
:root { --ce-focus: 0 0 0 3px #b39bff; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-variation-settings: 'opsz' 72; text-wrap: balance; }
p { text-wrap: pretty; }
:where(a, button, input, select, textarea, summary):focus-visible { outline: none; box-shadow: var(--ce-focus); border-radius: 4px; }
.ce-muted { color: var(--wp--preset--color--ink-muted); }
.ce-faint { color: var(--wp--preset--color--ink-faint); }
.ce-measure { max-width: 68ch; }
.skip-link:focus { background: var(--wp--preset--color--violet-strong); color: #fff; padding: 12px 16px; z-index: 1000; }

/* ---------- En-tête ---------- */
.ce-header { border-bottom: 1px solid var(--wp--preset--color--line); }
.ce-header .wp-block-navigation__responsive-container.is-menu-open { background: var(--wp--preset--color--bg); color: var(--wp--preset--color--ink); }

/* ---------- Sections ---------- */
.ce-section { padding-top: var(--wp--preset--spacing--90); padding-bottom: var(--wp--preset--spacing--90); }
.ce-section--alt { background: var(--wp--preset--color--surface-1); }
.ce-section--rule { border-top: 1px solid var(--wp--preset--color--line); }
.ce-hero { padding-top: var(--wp--preset--spacing--100); padding-bottom: var(--wp--preset--spacing--90); }
.ce-hero h1 { font-size: var(--wp--preset--font-size--hero); font-variation-settings: 'opsz' 96; letter-spacing: -0.03em; line-height: 1; font-weight: 750; }

/* ---------- Badge de disponibilité ---------- */
.ce-status { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 8px; border: 1px solid var(--wp--preset--color--line); border-radius: 999px; font-size: 0.875rem; line-height: 20px; font-weight: 600; margin: 0; }
.ce-status::before { content: ""; width: 8px; height: 8px; border-radius: 999px; background: var(--wp--preset--color--signal-ok); }
.ce-status.is-busy::before { background: var(--wp--preset--color--playhead); }

/* ---------- Timecode ---------- */
.ce-timecode { display: inline-block; font-family: var(--wp--preset--font-family--mono); font-size: 13px; line-height: 16px; font-weight: 500; letter-spacing: .02em; padding: 4px 8px; border-radius: 4px; background: var(--wp--preset--color--bg); color: var(--wp--preset--color--ink-muted); font-variant-numeric: tabular-nums; }

/* ---------- Cadre vidéo (façade : l'iframe ne charge qu'au clic) ---------- */
.ce-frame { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: var(--wp--preset--color--surface-2) center / cover no-repeat; margin: 0; }
.ce-frame--hero { box-shadow: var(--wp--preset--shadow--frame); }
.ce-frame--portrait { aspect-ratio: 9 / 16; }
.ce-frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ce-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.ce-frame .ce-timecode { position: absolute; left: 12px; bottom: 12px; }
.ce-frame__play { position: absolute; inset: 0; margin: auto; width: 72px; height: 72px; border-radius: 999px; border: 0; display: grid; place-items: center; background: var(--wp--preset--color--violet-strong); color: #fff; cursor: pointer; transition: transform .15s ease, background-color .15s ease; }
.ce-frame__play:hover { background: var(--wp--preset--color--violet); transform: scale(1.05); }
.ce-frame__play svg { width: 26px; height: 26px; margin-left: 4px; }
.ce-frame__label { position: absolute; top: 16px; left: 16px; font-size: 0.875rem; color: var(--wp--preset--color--ink-muted); }
.ce-frame.is-playing .ce-frame__play, .ce-frame.is-playing .ce-timecode, .ce-frame.is-playing .ce-frame__label, .ce-frame.is-playing img { display: none; }

/* ---------- Règle timeline (séparateur signature) ---------- */
.ce-ruler { position: relative; height: 40px; max-width: var(--wp--style--global--wide-size); margin-left: auto !important; margin-right: auto !important; overflow: hidden; }
.ce-ruler__labels { position: absolute; top: 0; left: 0; right: 0; display: flex; }
.ce-ruler__labels span { width: 120px; flex: none; padding-left: 4px; font-family: var(--wp--preset--font-family--mono); font-size: 11px; line-height: 14px; color: var(--wp--preset--color--ink-faint); }
.ce-ruler__ticks { position: absolute; left: 0; right: 0; bottom: 0; height: 12px; border-bottom: 1px solid var(--wp--preset--color--line);
  background-image: repeating-linear-gradient(to right, var(--wp--preset--color--violet) 0 1px, rgba(0,0,0,0) 1px 120px), repeating-linear-gradient(to right, var(--wp--preset--color--line-strong) 0 1px, rgba(0,0,0,0) 1px 12px);
  background-size: 100% 12px, 100% 6px; background-repeat: no-repeat; background-position: 0 0, 0 100%; }
.ce-ruler__head { position: absolute; top: 14px; bottom: -1px; left: var(--ce-head, 32%); width: 2px; background: var(--wp--preset--color--playhead); }
.ce-ruler__head::before { content: ""; position: absolute; top: 0; left: -6px; width: 14px; height: 8px; background: var(--wp--preset--color--playhead); border-radius: 4px 4px 0 0; }

/* ---------- Portfolio ---------- */
.ce-work { gap: 12px !important; }
.ce-work > * { margin: 0 !important; }
.ce-kind { font-size: 0.875rem; line-height: 20px; font-weight: 600; color: var(--wp--preset--color--violet); margin: 0; }

/* ---------- Avant / après ---------- */
.ce-compare { border-radius: 24px; padding: 32px; border: 1px solid var(--wp--preset--color--line); }
.ce-compare--after { background: var(--wp--preset--color--violet-soft); border-color: var(--wp--preset--color--violet); }
.ce-compare ul { margin: 0; padding-left: 20px; display: grid; gap: 12px; }
.ce-compare--before, .ce-compare--before h3 { color: var(--wp--preset--color--ink-muted); }

/* ---------- Déroulé (pistes) ---------- */
ol.ce-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: ce-step; }
ol.ce-steps > li { counter-increment: ce-step; position: relative; padding: 20px 20px 20px 88px; border-radius: 4px; background: var(--wp--preset--color--surface-2); color: var(--wp--preset--color--ink-muted); font-size: 0.9375rem; line-height: 1.55; }
ol.ce-steps > li::before { content: counter(ce-step, decimal-leading-zero); position: absolute; left: 20px; top: 22px; font-family: var(--wp--preset--font-family--mono); font-size: 13px; color: var(--wp--preset--color--ink-muted); }
ol.ce-steps > li strong { display: block; color: var(--wp--preset--color--ink); font-size: 1.25rem; line-height: 1.3; font-weight: 600; margin-bottom: 4px; }
ol.ce-steps > li:nth-child(2) { background: var(--wp--preset--color--violet-soft); }
ol.ce-steps > li:nth-child(2)::before { color: var(--wp--preset--color--playhead); }

/* ---------- Avis ---------- */
.ce-quote { margin: 0; }
.ce-quote p { font-size: 1.375rem; line-height: 1.45; font-weight: 500; letter-spacing: -0.01em; color: var(--wp--preset--color--ink); }
.ce-quote cite { display: block; margin-top: 20px; font-style: normal; font-size: 1rem; font-weight: 600; color: var(--wp--preset--color--ink); }
.ce-quote cite span { display: block; font-size: 0.875rem; font-weight: 400; color: var(--wp--preset--color--ink-muted); }

/* ---------- Offres ---------- */
.ce-tier { border-radius: 24px; padding: 32px; background: var(--wp--preset--color--bg); border: 1px solid var(--wp--preset--color--line); height: 100%; }
.ce-tier--featured { background: var(--wp--preset--color--violet-soft); border-color: var(--wp--preset--color--violet); }
.ce-tier__price { font-size: 2.25rem; line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.ce-tier ul { padding-left: 20px; margin: 0; display: grid; gap: 8px; font-size: 0.9375rem; }

/* ---------- Qui suis-je ---------- */
.ce-photo { aspect-ratio: 4 / 5; border-radius: 14px; overflow: hidden; background: var(--wp--preset--color--surface-2); }
.ce-photo img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Derniers articles ---------- */
.ce-latest.wp-block-latest-posts { padding: 0; }
.ce-latest.wp-block-latest-posts li { display: flex; flex-direction: column; gap: 8px; }
.ce-latest .wp-block-latest-posts__featured-image img { border-radius: 14px; aspect-ratio: 16 / 9; object-fit: cover; width: 100%; height: auto; }
.ce-latest .wp-block-latest-posts__post-title { font-size: 1.25rem; line-height: 1.4; font-weight: 600; color: var(--wp--preset--color--ink); text-decoration: none; }
.ce-latest .wp-block-latest-posts__post-title:hover { text-decoration: underline; }
.ce-latest .wp-block-latest-posts__post-date { color: var(--wp--preset--color--ink-faint); font-size: 0.875rem; }

/* ---------- FAQ ---------- */
.ce-faq .wp-block-details { border-bottom: 1px solid var(--wp--preset--color--line); margin: 0; }
.ce-faq .wp-block-details:first-child { border-top: 1px solid var(--wp--preset--color--line); }
.ce-faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 24px; align-items: center; padding: 24px 0; font-size: 1.25rem; line-height: 1.4; font-weight: 600; }
.ce-faq summary::-webkit-details-marker { display: none; }
.ce-faq summary::after { content: "+"; font-family: var(--wp--preset--font-family--mono); font-size: 22px; color: var(--wp--preset--color--violet); flex: none; }
.ce-faq details[open] summary::after { content: "–"; }
.ce-faq details > :not(summary) { margin: 0 0 24px; color: var(--wp--preset--color--ink-muted); max-width: 68ch; }

/* ---------- Contact ---------- */
.ce-contact { border-radius: 24px; padding: var(--wp--preset--spacing--70); background: var(--wp--preset--color--surface-1); }
.ce-contact :where(input[type=text], input[type=email], input[type=tel], input[type=url], select, textarea) { width: 100%; font: inherit; font-size: 1rem; line-height: 1.5; color: var(--wp--preset--color--ink); background: var(--wp--preset--color--bg); border: 1px solid var(--wp--preset--color--line-strong); border-radius: 8px; padding: 12px 16px; box-sizing: border-box; }
.ce-contact :where(input, select, textarea):focus-visible { border-color: #b39bff; }
.ce-contact label { font-size: 0.875rem; font-weight: 600; display: block; margin-bottom: 8px; }
.ce-contact :where(input[type=submit], button[type=submit]) { font: inherit; font-size: 1.125rem; font-weight: 600; padding: 16px 32px; border-radius: 8px; border: 0; background: var(--wp--preset--color--violet-strong); color: #fff; cursor: pointer; }
.ce-contact :where(input[type=submit], button[type=submit]):hover { background: var(--wp--preset--color--violet); color: var(--wp--preset--color--bg); }
.ce-contact .wpcf7-not-valid-tip { color: var(--wp--preset--color--signal-danger); font-size: 0.875rem; }

/* ---------- Pied de page ---------- */
.ce-footer { border-top: 1px solid var(--wp--preset--color--line); }

/* ---------- Mobile ---------- */
@media (max-width: 781px) {
  .ce-ruler__labels span:nth-child(n+5) { display: none; }
  .ce-contact { padding: 24px; }
  .ce-hero .wp-block-buttons { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .ce-frame__play { transition: none; }
  .ce-frame__play:hover { transform: none; }
}

/* Pied de page : au survol, le lien s'éclaire et un trait dégradé se dessine dessous */
.ce-footer .wp-block-navigation-item__content { position: relative; display: inline-block; padding: 4px 0; transition: color .3s ease, transform .35s cubic-bezier(.16, 1, .3, 1); }
.ce-footer .wp-block-navigation-item__content::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; border-radius: 99px; background: linear-gradient(90deg, #9b7bff, #ffb23f); transform: scaleX(0); transform-origin: right; transition: transform .45s cubic-bezier(.16, 1, .3, 1); }
.ce-footer .wp-block-navigation-item__content:hover, .ce-footer .wp-block-navigation-item__content:focus-visible { color: #fff; transform: translateY(-2px); }
.ce-footer .wp-block-navigation-item__content:hover::after, .ce-footer .wp-block-navigation-item__content:focus-visible::after { transform: scaleX(1); transform-origin: left; }
.ce-footer .wp-block-navigation__container:hover .wp-block-navigation-item__content:not(:hover) { opacity: .6; }
.ce-footer .wp-block-navigation-item__content { transition: color .3s ease, transform .35s cubic-bezier(.16, 1, .3, 1), opacity .3s ease; }
@media (prefers-reduced-motion: reduce) { .ce-footer .wp-block-navigation-item__content, .ce-footer .wp-block-navigation-item__content::after { transition: none; } }
.ce-legal-links a { color: inherit; text-decoration: none; transition: color .25s; } .ce-legal-links a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
