/**
 * Selex & Home — supplemental styles.
 *
 * Only rules that theme.json cannot express live here (sticky positioning,
 * scroll offsets, focus rings, motion guards, the handful of component
 * classes the patterns use). Visual design tokens (colours, fonts, spacing)
 * belong in theme.json. This file is also loaded in the editor
 * (add_editor_style) so Charlotte sees the same thing while editing.
 */

/* --- Sticky header ------------------------------------------------------- */
/* The header template part renders as <header class="wp-block-template-part">
   wrapping the inner .selex-header group; position:sticky must sit on that
   wrapper (a direct child of the scroll container). */
header.wp-block-template-part { position: sticky; top: 0; z-index: 100; }
.selex-header {
  background: var(--wp--preset--color--base);
  border-bottom: 1px solid #ECECE9;
}

/* Contact menu item styled as a button. Core gives every item the nav font;
   we only add the box. */
.selex-nav .selex-nav-cta .wp-block-navigation-item__content {
  background: var(--wp--preset--color--eucalyptus);
  color: var(--wp--preset--color--base);
  border-radius: 8px;
  padding: 0.5em 1.1em;
}
.selex-nav .selex-nav-cta .wp-block-navigation-item__content:hover { background: #255B54; text-decoration: none; }
/* The burger-menu overlay: padded, centred, larger links, and the Contact
   button keeps its box (core zeroes the padding of every item in the overlay). */
.selex-nav .wp-block-navigation__responsive-container.is-menu-open {
  --navigation-layout-justification-setting: center;
  padding: 1.25rem 1.5rem;
}
.selex-nav .is-menu-open .wp-block-navigation__responsive-container-content { padding-top: 3.5rem; }
.selex-nav .is-menu-open .wp-block-navigation__container { align-items: center !important; gap: 1.6rem; font-size: 1rem; }
.selex-nav .is-menu-open .wp-block-navigation-item { align-items: center !important; }
.selex-nav .is-menu-open .selex-nav-cta { margin-top: 1rem; }
.selex-nav .is-menu-open .selex-nav-cta .wp-block-navigation-item__content { padding: 0.7em 1.8em !important; }
/* Six uppercase links do not fit beside the logo on a tablet. Core switches to
   the burger menu under 600px only; do it under 900px, and tighten the links
   on small laptops so the header stays on one row at every width. */
.selex-header { flex-wrap: nowrap !important; }
@media (min-width: 600px) and (max-width: 899px) {
  .selex-nav .wp-block-navigation__responsive-container-open:not(.always-shown) { display: flex; }
  .selex-nav .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) { display: none; }
}
@media (min-width: 900px) and (max-width: 1199px) {
  .selex-nav { font-size: 0.78rem !important; letter-spacing: 0.08em !important; }
  .selex-nav .wp-block-navigation__container { gap: 0.9rem; }
}

/* --- Flush sections ------------------------------------------------------- */
/* WordPress inserts a top margin between the root blocks (main / footer);
   sections manage their own padding, so zero it. */
.wp-site-blocks > * { margin-block-start: 0; }
.selex-page-title,
.selex-page-body,
.selex-section { margin-block: 0; }
.selex-page-title,
.selex-section { scroll-margin-top: 6rem; }
#wp--skip-link--target { scroll-margin-top: 6rem; }
@media (max-width: 600px) {
  .selex-page-title, .selex-page-body, .selex-section { padding-left: 1rem !important; padding-right: 1rem !important; }
}

/* --- Small label (eyebrow) ------------------------------------------------ */
/* « MES PRESTATIONS MAISON », « L’INTENTION »… the small uppercase line above
   a heading in the mockups. */
.selex-label {
  font-family: var(--wp--preset--font-family--cormorant);   /* also used on an h2 */
  line-height: 1.6;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--wp--preset--color--eucalyptus);
  margin-bottom: 0.5rem;
}
.selex-label--rose   { color: #9B6B6B; }   /* rose, darkened to 4.5:1 on white */
.selex-label--violet { color: #6F6485; }   /* violet, darkened to 4.5:1 on white */

/* --- Quote between sections ---------------------------------------------- */
.selex-citation {
  font-family: var(--wp--preset--font-family--playfair);
  font-style: italic;
  font-size: clamp(1.25rem, 1rem + 1vw, 1.6rem);
  line-height: 1.4;
  text-align: center;
  text-wrap: balance;
  hyphens: manual;
  max-width: 40rem;
  margin-inline: auto;
  color: #4A4A47;
}
/* Directly in a section, a quote may use the wide measure: it then sits on one
   line wherever the screen allows, and breaks evenly where it does not. */
.selex-section > .selex-citation { max-width: min(100%, var(--wp--style--global--wide-size)); }

/* --- Cards ----------------------------------------------------------------- */
/* White card, thin border, a 3px coloured top edge in one of the three
   accents. Patterns alternate --sage / --rose / --violet. */
.selex-card {
  background: var(--wp--preset--color--base);
  border: 1px solid #E6E6E3;
  border-top: 3px solid var(--wp--preset--color--sage);
  border-radius: 12px;
  padding: 1.5rem;
  height: 100%;
}
.selex-card--rose   { border-top-color: var(--wp--preset--color--rose); }
.selex-card--violet { border-top-color: var(--wp--preset--color--violet); }
.selex-card > :first-child { margin-top: 0; }
.selex-card > :last-child { margin-bottom: 0; }
.selex-card h3, .selex-card h4 { font-family: var(--wp--preset--font-family--cormorant); font-weight: 600; font-size: 1.15rem; letter-spacing: 0.04em; margin-bottom: 0.4rem; }
.selex-card p { font-size: 1.05rem; line-height: 1.5; }
/* Tinted variants (testimonials, value cards). */
.selex-card--tint-rose   { background: var(--wp--preset--color--rose-light);   border-color: transparent; border-top-color: var(--wp--preset--color--rose); }
.selex-card--tint-violet { background: var(--wp--preset--color--violet-light); border-color: transparent; border-top-color: var(--wp--preset--color--violet); }
.selex-card--tint-sage   { background: var(--wp--preset--color--sage-light);   border-color: transparent; border-top-color: var(--wp--preset--color--sage); }

/* Card grids: a group with .selex-cards holding .selex-card children. */
.selex-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(16rem, 100%), 1fr));
  gap: 1.25rem;
}
.selex-cards > * { margin: 0; }
/* Photo-and-text rows (homepage hero, À propos): core stacks columns under
   782px, which on a tablet puts a full-width portrait photo under the text.
   Keep the two columns side by side down to 600px. */
@media (min-width: 600px) and (max-width: 781px) {
  .wp-block-columns.selex-media-cols { flex-wrap: nowrap !important; gap: 2rem; }
  .wp-block-columns.selex-media-cols > .wp-block-column:not(:has(> .wp-block-image)) { flex-basis: 58% !important; }
  .wp-block-columns.selex-media-cols > .wp-block-column:has(> .wp-block-image) { flex-basis: 42% !important; }
}
/* Fixed-count rows never leave an orphan card: --2 is a pair at content width,
   --3 a multiple of three (3 → 2 → 1 columns), --4 a multiple of four
   (4 → 2 → 1). Two classes, to win over the block's own grid rule. */
.selex-cards.selex-cards--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.selex-cards.selex-cards--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.selex-cards.selex-cards--4,
.wp-block-post-template.selex-projects { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1099px) {
  .selex-cards.selex-cards--4,
  .wp-block-post-template.selex-projects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 899px) {
  .selex-cards.selex-cards--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 599px) {
  .selex-cards.selex-cards--2,
  .selex-cards.selex-cards--3,
  .selex-cards.selex-cards--4,
  .wp-block-post-template.selex-projects { grid-template-columns: minmax(0, 1fr); }
}
/* Prestation cards on the homepage: a bullet before each sub-title. */
.selex-card--list h3::before { content: "•"; margin-right: 0.45em; color: var(--wp--preset--color--eucalyptus); }
.selex-card--list.selex-card--rose h3::before { color: #9B6B6B; }
.selex-card--list.selex-card--violet h3::before { color: #6F6485; }

/* --- Numbered steps ------------------------------------------------------- */
/* An ordered list; each item gets a numbered circle via CSS counters. */
.selex-steps {
  list-style: none;
  counter-reset: selex-step;
  padding: 0;
  margin: 0;
  /* Centred rows: an incomplete last row sits in the middle, whatever the count. */
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.75rem 1.25rem;
  margin-top: 1.25rem;
}
.selex-steps > li { counter-increment: selex-step; padding: 0; margin: 0; flex: 0 1 14rem; text-align: center; hyphens: manual; }
/* Steps that are a single word each (no description). */
.selex-steps--compact { margin-top: 1.75rem; margin-bottom: 4.5rem; }
.selex-steps--compact > li { flex-basis: 7.5rem; }
.selex-steps > li::before {
  content: counter(selex-step, decimal-leading-zero);
  display: grid;
  margin-inline: auto;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: var(--wp--preset--color--sage-light);
  color: var(--wp--preset--color--eucalyptus);
  font-family: var(--wp--preset--font-family--cormorant);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.6rem;
}
.selex-steps > li:nth-child(3n+2)::before { background: var(--wp--preset--color--rose-light); color: #9B6B6B; }
.selex-steps > li:nth-child(3n+3)::before { background: var(--wp--preset--color--violet-light); color: #6F6485; }
/* Lists that sit three to a row mirror the colours on every other row
   (sage rose violet / violet rose sage), so no colour stacks in a column. */
.selex-steps:not(.selex-steps--compact) > li:nth-child(6n+4)::before { background: var(--wp--preset--color--violet-light); color: #6F6485; }
.selex-steps:not(.selex-steps--compact) > li:nth-child(6n+6)::before { background: var(--wp--preset--color--sage-light); color: var(--wp--preset--color--eucalyptus); }
/* Row variant: the items share the full width (only the gap between them) and
   read left to right — « Notre accompagnement ». */
.selex-steps--row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(12rem, 100%), 1fr)); margin-top: 1.75rem; }
.selex-steps--row > li { text-align: start; }
.selex-steps--row > li::before { margin-inline: 0; }
.selex-steps strong { display: block; font-family: var(--wp--preset--font-family--cormorant); font-weight: 600; letter-spacing: 0.04em; }

/* --- Pill navigation (prestations pages) ---------------------------------- */
.selex-pills .wp-block-button__link {
  background: transparent;
  color: var(--wp--preset--color--eucalyptus);
  border: 1px solid var(--wp--preset--color--eucalyptus);
  border-radius: 999px;
  padding: 0.55em 1.3em;
}
.selex-pills .wp-block-button__link:hover,
.selex-pills .wp-block-button__link:focus {
  background: var(--wp--preset--color--eucalyptus);
  color: var(--wp--preset--color--base);
}

/* --- Bands (price, CTA) --------------------------------------------------- */
.selex-band {
  background: var(--wp--preset--color--sage-light);
  border-radius: 16px;
  padding: 2rem;
}
.selex-band--rose   { background: var(--wp--preset--color--rose-light); }
.selex-band--violet { background: var(--wp--preset--color--violet-light); }
.selex-band > :first-child { margin-top: 0; }
.selex-band > :last-child { margin-bottom: 0; }

/* --- Footer --------------------------------------------------------------- */
.selex-footer-links { list-style: none; padding: 0; margin: 0; }
.selex-footer-links li { margin-bottom: 0.35rem; }
/* The phone slot is a paragraph Charlotte fills in once she has a number;
   while empty it takes no space. */
.selex-phone:empty { display: none; }
.selex-tagline { max-width: 26rem; margin-top: 0.75rem; }
.selex-footer-logo { margin-top: 1rem; }

/* --- Editor-placed photos ------------------------------------------------ */
/* Corner radius, caption font and lightbox come from theme.json; this only
   handles what theme.json cannot: caption alignment and gallery rhythm. */
figcaption.wp-element-caption { text-align: center; opacity: .8; margin-top: .6rem; }
.wp-block-gallery.has-nested-images { gap: 1rem; }

/* --- Visible keyboard focus ---------------------------------------------- */
a:focus-visible,
.wp-block-navigation-item__content:focus-visible,
summary:focus-visible,
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--wp--preset--color--contrast);
  outline-offset: 3px;
  border-radius: 2px;
}
.wp-block-button__link:focus-visible {
  outline: 2px solid var(--wp--preset--color--contrast);
  outline-offset: 3px;
}

/* --- Motion -------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .selex-card { transition: transform .2s ease, box-shadow .2s ease; }
  .selex-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(42, 42, 40, 0.06); }
  /* FAQ (core Details block): the content fades/slides in everywhere; where the
     browser supports ::details-content + interpolate-size (Chromium 131+) the
     height also eases open and closed. Closing is instant elsewhere: a native
     <details> cannot delay its own collapse without JS. */
  .wp-block-details[open] > :not(summary) { animation: selex-reveal .3s ease both; }
  @keyframes selex-reveal { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
  .wp-block-details { interpolate-size: allow-keywords; }
  .wp-block-details::details-content {
    height: 0; overflow: clip;
    transition: height .3s ease, content-visibility .3s allow-discrete;
  }
  .wp-block-details[open]::details-content { height: auto; }
}

/* --- Outline button style ------------------------------------------------- */
/* theme.json paints every button eucalyptus/white; core's "Contour" style only
   makes the background transparent, which would leave white text. */
.wp-block-button.is-style-outline .wp-block-button__link {
  background: transparent;
  color: var(--wp--preset--color--eucalyptus);
  border: 1px solid var(--wp--preset--color--eucalyptus);
}
.wp-block-button.is-style-outline .wp-block-button__link:hover,
.wp-block-button.is-style-outline .wp-block-button__link:focus {
  background: var(--wp--preset--color--eucalyptus);
  color: var(--wp--preset--color--base);
}

/* --- Text flow ------------------------------------------------------------ */
/* Body paragraphs are justified, with French hyphenation (the page is
   lang="fr-FR") so narrow columns do not open rivers. Anything with an explicit
   alignment (centred paragraphs, quotes) keeps it: those rules are class
   selectors and win over this element selector. */
main p,
.is-root-container p {
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
  hyphenate-limit-chars: 7 3 3;
  text-wrap: pretty;
}
/* Labels are never justified (a two-line label would be spread out). */
main p.selex-label:not([class*="has-text-align"]),
.is-root-container p.selex-label:not([class*="has-text-align"]),
main p.selex-form-info { text-align: start; }
/* A justified paragraph under a centred title: centre its last line too. */
main .has-text-align-center + p:not([class*="has-text-align"], .selex-label, .selex-citation),
main .has-text-align-center + p:not([class*="has-text-align"], .selex-label, .selex-citation) + p:not([class*="has-text-align"], .selex-label, .selex-citation) {
  text-align-last: center;
}
/* Titles break into lines of even length instead of leaving one word alone;
   a centred section title may use the wide measure, so it sits on one line
   wherever the screen allows. */
h1, h2, h3, .selex-label { text-wrap: balance; hyphens: manual; }
.selex-section > :is(h1, h2).has-text-align-center { max-width: min(100%, var(--wp--style--global--wide-size)); }

/* --- Réalisation pages: « AVANT » / « APRÈS » ------------------------------ */
/* A small framed label centred above each gallery (seeded by the seeder as an
   h2 with this class). */
.selex-phase {
  width: fit-content;
  margin-top: 2.5rem;
  margin-bottom: 1.25rem;
  padding: 0.4em 1.8em;
  border: 1px solid var(--wp--preset--color--contrast);
  border-radius: 10px;
  font-family: var(--wp--preset--font-family--cormorant);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1.6;
  text-transform: uppercase;
}

/* --- Contact form (Contact Form 7 markup) --------------------------------- */
.selex-form .wpcf7 input:not([type="checkbox"]):not([type="submit"]),
.selex-form .wpcf7 textarea {
  width: 100%;
  box-sizing: border-box;   /* 100% includes padding + border, else the field overflows the card */
  font: inherit;
  padding: 0.7em 0.9em;
  border: 1px solid #CFD9D6;
  border-radius: 8px;
  background: var(--wp--preset--color--base);
  margin-bottom: 0.9rem;
}
.selex-form .wpcf7 textarea { min-height: 8rem; }
.selex-form .wpcf7 .wpcf7-form-control-wrap { display: block; }
.selex-form .wpcf7 .wpcf7-checkbox { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; margin-bottom: 1rem; }
.selex-form .wpcf7 .wpcf7-list-item { margin: 0; }
.selex-form .wpcf7 .wpcf7-list-item label { display: inline-flex; align-items: center; gap: 0.4em; font-size: 1.05rem; }
.selex-form .wpcf7 input[type="checkbox"] { accent-color: var(--wp--preset--color--eucalyptus); width: 1.1em; height: 1.1em; }
.selex-form-label { font-size: 0.85rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--wp--preset--color--eucalyptus); margin: 0.5rem 0 0.4rem; }
.selex-form .wpcf7 input[type="submit"] {
  font-family: var(--wp--preset--font-family--cormorant);
  font-size: 0.85rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  background: var(--wp--preset--color--eucalyptus); color: var(--wp--preset--color--base);
  border: 0; border-radius: 8px; padding: 0.85em 1.8em; cursor: pointer;
}
.selex-form .wpcf7 input[type="submit"]:hover { background: #255B54; }
.selex-form .wpcf7 .wpcf7-not-valid-tip { color: #9B3F3F; font-size: 0.95rem; margin: -0.6rem 0 0.9rem; }
.selex-form .wpcf7 .wpcf7-response-output { border: 1px solid var(--wp--preset--color--sage); border-radius: 8px; padding: 0.8em 1em; margin: 1rem 0 0; }
.selex-form .wpcf7 form.sent .wpcf7-response-output { border-color: var(--wp--preset--color--eucalyptus); background: var(--wp--preset--color--base); }
.selex-form-info { opacity: 0.85; margin-top: 1rem; }

/* --- After a successful send ---------------------------------------------- */
/* CF7's script adds class "sent" to the form: the fields collapse, the
   confirmation becomes a card, and the reset link (appended by
   selex_cf7_again_link(), inc/privacy.php) appears. Failures keep the fields. */
.selex-form-again { display: none; }
.selex-form .wpcf7 form.sent > :not(.screen-reader-response):not(.wpcf7-response-output):not(.selex-form-again) {
  display: none;
}
.selex-form .wpcf7 form.sent .wpcf7-response-output {
  margin: 0;
  padding: 1.6em 1.6em 1.4em;
  text-align: center;
  font-family: var(--wp--preset--font-family--playfair);
  font-size: var(--wp--preset--font-size--large);
  line-height: 1.35;
  border-color: var(--wp--preset--color--eucalyptus);
  background: var(--wp--preset--color--base);
}
.selex-form .wpcf7 form.sent .wpcf7-response-output::before {
  content: "✓";
  display: block;
  margin-bottom: 0.3em;
  font-family: var(--wp--preset--font-family--cormorant);
  font-size: 2.2rem;
  line-height: 1;
  color: var(--wp--preset--color--eucalyptus);
}
/* CF7 renders the response output last, after the appended link: flex + order
   puts the link under the card. */
.selex-form .wpcf7 form.sent { display: flex; flex-direction: column; }
.selex-form .wpcf7 form.sent .selex-form-again { display: block; order: 2; text-align: center; margin: 1.2rem 0 0; }
.selex-form .wpcf7 form.sent .selex-form-again a {
  display: inline-block;
  font-size: 0.85rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--wp--preset--color--eucalyptus);
  border: 1px solid var(--wp--preset--color--eucalyptus);
  border-radius: 8px; padding: 0.85em 1.8em; text-decoration: none;
}
.selex-form .wpcf7 form.sent .selex-form-again a:hover,
.selex-form .wpcf7 form.sent .selex-form-again a:focus-visible {
  background: var(--wp--preset--color--eucalyptus);
  color: var(--wp--preset--color--base);
}
@media (prefers-reduced-motion: no-preference) {
  /* Fields fold away, then the card and the link fade in. Browsers that cannot
     animate `display` end on the max-height/visibility keyframe: collapsed too. */
  .selex-form .wpcf7 form.sent > :not(.screen-reader-response):not(.wpcf7-response-output):not(.selex-form-again) {
    display: block;
    overflow: hidden;
    animation: selex-form-collapse .35s ease forwards;
  }
  @keyframes selex-form-collapse {
    from { max-height: 20rem; opacity: 1; }
    to   { max-height: 0; opacity: 0; margin: 0; padding: 0; visibility: hidden; display: none; }
  }
  .selex-form .wpcf7 form.sent .wpcf7-response-output { animation: selex-reveal .45s ease .25s both; }
  .selex-form .wpcf7 form.sent .selex-form-again { animation: selex-reveal .45s ease .45s both; }
}
/* Honeypot: off-screen for humans, present for bots. */
.selex-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
