/*
Theme Name: L2N Store
Theme URI: https://l2nstore.fr
Description: Theme enfant L2N - stores, protection solaire et fermetures
Author: L2N
Version: 1.1.0
Text Domain: l2n
*/

/* --- Confort de lecture ------------------------------------------------ */

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

h1, h2, h3, .wp-block-heading { text-wrap: balance; }
p, li { text-wrap: pretty; }

/* Premier paragraphe d'une page : leger accent d'introduction */
.wp-block-post-content > p:first-of-type {
    font-size: var(--wp--preset--font-size--large);
    line-height: 1.6;
    color: #4a3f37;
}

/* --- Liens ------------------------------------------------------------- */

a { transition: color .18s ease, text-decoration-color .18s ease; }
.wp-block-post-content a:not(.wp-block-button__link) {
    text-decoration-thickness: 1px;
    text-underline-offset: .18em;
    text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
}
.wp-block-post-content a:not(.wp-block-button__link):hover {
    text-decoration-color: currentColor;
}

/* --- Accessibilite au clavier ------------------------------------------ */

:where(a, button, input, select, textarea, summary):focus-visible {
    outline: 2px solid var(--wp--preset--color--anthracite);
    outline-offset: 2px;
    border-radius: 2px;
}
.has-anthracite-background-color :focus-visible,
.has-anthracite-background-color :focus-visible {
    outline-color: var(--wp--preset--color--creme);
}

/* --- Boutons ----------------------------------------------------------- */

.wp-block-button__link {
    transition: background-color .18s ease, transform .12s ease, box-shadow .18s ease;
}
.wp-block-button__link:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(98,62,42,.18); }
.wp-block-button__link:active { transform: translateY(0); box-shadow: none; }

.wp-block-button.is-style-outline .wp-block-button__link {
    border-width: 1px;
    background: transparent;
}

/* --- Listes ------------------------------------------------------------ */

.wp-block-post-content ul:not(.wp-block-navigation__container) { list-style: none; padding-left: 0; }
.wp-block-post-content ul:not(.wp-block-navigation__container) > li {
    position: relative;
    padding-left: 1.6rem;
    margin-bottom: .6rem;
}
.wp-block-post-content ul:not(.wp-block-navigation__container) > li::before {
    content: "";
    position: absolute;
    left: .35rem;
    top: .72em;
    width: 6px; height: 6px;
    background: var(--wp--preset--color--bronze-texte);
    transform: rotate(45deg);
}
.wp-block-post-content ol > li { margin-bottom: .6rem; padding-left: .3rem; }
.wp-block-post-content ol > li::marker {
    color: var(--wp--preset--color--bronze);
    font-weight: 600;
}

/* --- Sections sombres ---------------------------------------------------
   Ne jamais redefinir ici une variable de palette qui sert aussi au fond du
   meme element : le fond se mordrait la queue. On pose les couleurs.
   Contrastes mesures sur anthracite #202322 :
     creme #F3F0E9        13,93:1
     bronze clair #C8A882  7,08:1                                        */

.has-anthracite-background-color {
    color: var(--wp--preset--color--creme);
}

.has-anthracite-background-color :is(h1, h2, h3, h4, h5, h6, p, li, blockquote, figcaption) {
    color: inherit;
}

.has-anthracite-background-color a:not(.wp-element-button) {
    color: var(--wp--preset--color--bronze-clair);
}

/* l2n-survol-navbar : survol des liens de la navbar.
   Le conteneur de navigation porte has-anthracite-background-color pour
   l'overlay du telephone, mais sur grand ecran ce fond n'est pas peint.
   Sans ces deux regles, le lien survole devient blanc sur blanc. */
.l2n-navbar .wp-block-navigation__responsive-container:not(.is-menu-open)
  .wp-block-navigation__container > .wp-block-navigation-item:not(:last-child)
  > .wp-block-navigation-item__content:hover {
  color: var(--wp--preset--color--bronze-texte);
  text-decoration: underline;
  text-underline-offset: 0.35em;
  text-decoration-thickness: 1px;
}
.l2n-navbar .wp-block-navigation__responsive-container:not(.is-menu-open)
  .wp-block-navigation__container > .wp-block-navigation-item:last-child
  > .wp-block-navigation-item__content:hover {
  background: var(--wp--preset--color--bronze-survol);
  color: var(--wp--preset--color--blanc);
  text-decoration: none;
}
/* fin l2n-survol-navbar */

.has-anthracite-background-color:not(.wp-block-navigation__responsive-container) a:not(.wp-element-button):hover,
.wp-block-navigation__responsive-container.is-menu-open a:not(.wp-element-button):hover {
    color: var(--wp--preset--color--blanc);
}

/* --- Images ------------------------------------------------------------ */

.wp-block-image img { border-radius: 3px; }
.wp-block-image figcaption {
    font-size: var(--wp--preset--font-size--small);
    color: #6b6259;
    text-align: center;
}

/* --- En-tete ----------------------------------------------------------- */

.wp-block-site-logo img { max-height: 64px; width: auto; }

.wp-block-navigation a { text-decoration: none; }
.wp-block-navigation .wp-block-navigation-item__content { transition: color .18s ease; }
.wp-block-navigation .current-menu-item > .wp-block-navigation-item__content {
    text-decoration: underline;
    text-decoration-color: var(--wp--preset--color--bronze-texte);
    text-decoration-thickness: 2px;
    text-underline-offset: .35em;
}

/* Dernier element du menu traite comme un bouton */
.wp-block-navigation__container > .wp-block-navigation-item:last-child > a {
    background: var(--wp--preset--color--anthracite);
    color: #fff;
    padding: .55rem 1.1rem;
    border-radius: 3px;
    transition: background-color .18s ease;
}
.wp-block-navigation__container > .wp-block-navigation-item:last-child > a:hover {
    background: var(--wp--preset--color--anthracite);
}
@media (max-width: 781px) {
    .wp-block-navigation__container > .wp-block-navigation-item:last-child > a {
        background: none; color: inherit; padding: 0;
    }
}

/* --- Pied de page ------------------------------------------------------ */

.wp-block-group.has-anthracite-background-color a { text-decoration: none; }
.wp-block-group.has-anthracite-background-color a:hover { text-decoration: underline; }

/* --- Tableaux ---------------------------------------------------------- */

.wp-block-table table { border-collapse: collapse; }
.wp-block-table :is(th, td) {
    border: 1px solid var(--wp--preset--color--sable);
    padding: .65rem .85rem;
}
.wp-block-table th { background: var(--wp--preset--color--creme); text-align: left; }

/* --- Impression -------------------------------------------------------- */

@media print {
    .wp-block-navigation, .wp-block-buttons, .l2n-form { display: none; }
    body { color: #000; font-size: 11pt; }
}

/* ======================================================================
   Navbar
   ====================================================================== */

.l2n-navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--wp--preset--color--sable);
    transition: box-shadow .2s ease;
}
.l2n-navbar.est-colle { box-shadow: 0 2px 16px rgba(42,33,27,.08); }

.l2n-navbar__inner { width: 100%; gap: 1.5rem; }

.l2n-navbar__marque { gap: .8rem; align-items: center; }
.l2n-navbar__marque .wp-block-site-logo img { max-height: 52px; width: auto; }
.l2n-navbar__nom { line-height: 1.1; }
.l2n-navbar__nom .wp-block-site-title a {
    text-decoration: none;
    color: var(--wp--preset--color--anthracite);
}
.l2n-navbar__baseline { margin: .15rem 0 0; }

.l2n-navbar__actions { gap: 1.5rem; align-items: center; }

.l2n-tel {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    white-space: nowrap;
    font-weight: 600;
    text-decoration: none;
    color: var(--wp--preset--color--anthracite);
    border: 1px solid var(--wp--preset--color--bronze-texte);
    border-radius: 3px;
    padding: .5rem 1rem;
    transition: background-color .18s ease, color .18s ease;
}
.l2n-tel:hover { background: var(--wp--preset--color--anthracite); color: #fff; }

@media (max-width: 980px) {
    .l2n-navbar__baseline { display: none; }
}
@media (max-width: 600px) {
    .l2n-tel { padding: .45rem .7rem; font-size: .9rem; }
    .l2n-navbar__nom .wp-block-site-title { font-size: 1.15rem !important; }
}

/* Menu superpose sur mobile */
.wp-block-navigation__responsive-container.is-menu-open {
    padding: 2rem 1.5rem;
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
    gap: 1.2rem;
}

/* ======================================================================
   En-tete de page et fil d'Ariane
   ====================================================================== */

.l2n-entete .wp-block-post-title {
    margin-top: .6rem;
    max-width: 22ch;
}

.l2n-fil {
    font-size: .85rem;
    color: #6b6259;
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    align-items: center;
}
.l2n-fil a { color: inherit; text-decoration: none; }
.l2n-fil a:hover { color: var(--wp--preset--color--anthracite); text-decoration: underline; }
.l2n-fil .sep { color: var(--wp--preset--color--bronze-texte); }
.l2n-fil [aria-current="page"] { color: var(--wp--preset--color--anthracite); font-weight: 500; }

/* ======================================================================
   FAQ
   ====================================================================== */

.l2n-faq { margin-top: 3.5rem; }
.l2n-faq > h2 { margin-bottom: 1.25rem; }

.l2n-faq__item {
    border-top: 1px solid var(--wp--preset--color--sable);
    padding: .1rem 0;
}
.l2n-faq__item:last-of-type { border-bottom: 1px solid var(--wp--preset--color--sable); }

.l2n-faq__item > summary {
    cursor: pointer;
    list-style: none;
    padding: 1rem 2.2rem 1rem 0;
    font-weight: 600;
    font-family: var(--wp--preset--font-family--titre);
    font-size: 1.12rem;
    position: relative;
    transition: color .18s ease;
}
.l2n-faq__item > summary::-webkit-details-marker { display: none; }
.l2n-faq__item > summary:hover { color: var(--wp--preset--color--anthracite); }

.l2n-faq__item > summary::after {
    content: "";
    position: absolute;
    right: .4rem;
    top: 1.45rem;
    width: 9px; height: 9px;
    border-right: 2px solid var(--wp--preset--color--bronze-texte);
    border-bottom: 2px solid var(--wp--preset--color--bronze-texte);
    transform: rotate(45deg);
    transition: transform .2s ease;
}
.l2n-faq__item[open] > summary::after { transform: rotate(-135deg); top: 1.7rem; }

.l2n-faq__r { padding: 0 2rem 1.2rem 0; }
.l2n-faq__r p { margin: 0; color: #4a3f37; }

/* >>> l2n-navbar-telephone — ne pas editer a la main, pose par script
   Le bouton telephone a fait passer la navbar sur deux lignes : le
   contenu demandait 1380 px pour 1240 disponibles. Mesure faite au
   navigateur, trois corrections cumulees valent 140 px.                */

/* 1. Le telephone au gabarit du menu, sans cadre : 189 px -> 150 px */
.l2n-navbar .l2n-tel{
  font-size:.95rem;
  padding:.35rem .55rem;
  border:0;
  white-space:nowrap;
}

/* 2. La navbar n'est plus bridee a 1240 px : elle suit l'ecran */
.l2n-navbar__inner{
  gap:16px;
  max-width:none;
  padding-inline:clamp(1rem,3vw,2.5rem);
}
.l2n-navbar__actions{gap:16px}

/* 3. Le menu d'un cran plus serre */
.l2n-navbar .wp-block-navigation{gap:1rem}
.l2n-navbar .wp-block-navigation__container > .wp-block-navigation-item > a{font-size:.9rem}

/* Sous 1366 px le numero cede la place, le pictogramme reste cliquable.
   Le numero en toutes lettres demeure au pied de page et sur Contact. */
@media (max-width:1365px){
  .l2n-navbar .l2n-tel{font-size:0;padding:.35rem .45rem}
  .l2n-navbar .l2n-tel span{font-size:1.15rem}
}
/* <<< l2n-navbar-telephone */

/* Chargee apres style.css, la regle de mise en page de WordPress
   remet max-width:1240px. Un cran de specificite suffit. */
.l2n-navbar .l2n-navbar__inner{max-width:none}

/* >>> l2n-logo-reserve — ne pas editer a la main, pose par script
   Le logo reserve sa place des le premier affichage : sans cela, le texte de
   l'en-tete s'affiche d'abord puis descend de 12 px a l'arrivee de l'image
   (decalage de mise en page, mesure par Google).                          */
.l2n-navbar__marque .wp-block-site-logo img{
  width:52px;
  height:52px;
  max-height:none;
  object-fit:contain;
}
/* <<< l2n-logo-reserve */

/* >>> l2n-retouches — ne pas editer a la main, pose par script */

/* 1. Boutons contour (telephone, « Decouvrir nos equipements ») : meme hauteur
      que les boutons pleins. Le filet de 1 px est retire du rembourrage, sinon
      le bouton contour mesure 37 px et le bouton plein 44 px. */
.wp-block-button.is-style-outline > .wp-block-button__link,
.wp-block-button .wp-block-button__link.is-style-outline{
  padding:calc(.9rem - 1px) calc(1.75rem - 1px);
}

/* 2. Texte des pages sur grand ecran : colonne de 840px au lieu de 720px et
      texte de 1.1875rem au lieu de 18px. Reste sous ~80 caracteres par ligne,
      limite au-dela de laquelle la lecture se fatigue. */
@media (min-width:1100px){
  body{--wp--style--global--content-size:840px}
  .wp-block-post-content{font-size:1.1875rem}
}

/* 3. Entre le titre de la page et le texte, trois espaces s'additionnaient :
      48 + 24 + 56 = 128 px. Ils sont ramenes a 48 + 0 + 40 = 88 px. */
main > .l2n-entete + .wp-block-group{
  margin-block-start:0;
  padding-top:2.5rem !important;
}
/* <<< l2n-retouches */

/* >>> l2n-titres — ne pas editer a la main, pose par script */

/* Les H1 et H2 sont en graisse 600 (reglage dans theme.json). Seule exception :
   le grand « L2N » de l'accueil garde la graisse fine, il fait office de
   signature a cote du logo. */
body.home h1.wp-block-heading{font-weight:400}
/* <<< l2n-titres */
