/* =========================================================================
   Chez Lbena — Feuille de style principale
   Design system : palette zellige + motif khatam + Marcellus / Cairo
   ========================================================================= */

:root {
  /* Palette traditionnelle marocaine */
  --clb-clay:        #B24A2E; /* terre cuite */
  --clb-clay-dark:   #8E3A22;
  --clb-saffron:     #E0A12E; /* safran / ocre */
  --clb-saffron-soft:#F2C879;
  --clb-green:       #2F6B4F; /* vert zellige */
  --clb-green-dark:  #234F3B;
  --clb-sand:        #FAF3E7; /* fond sable */
  --clb-sand-2:      #F2E7D2;
  --clb-ink:         #2A211A; /* brun encre */
  --clb-ink-soft:    #5B5046;
  --clb-line:        #E3D6BD;
  --clb-white:       #FFFDF8;

  /* Typographie */
  --clb-font-display: "Marcellus", "Times New Roman", serif;
  --clb-font-body:    "Cairo", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Mesures */
  --clb-maxw: 1180px;
  --clb-radius: 4px;
  --clb-shadow: 0 18px 40px -24px rgba(42, 33, 26, .55);
  --clb-header-h: 84px;
}

/* ----- Reset léger ----- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--clb-font-body);
  font-size: 17px;
  line-height: 1.7;
  color: var(--clb-ink);
  background-color: var(--clb-sand);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--clb-clay); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--clb-clay-dark); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--clb-font-display);
  font-weight: 400;
  line-height: 1.15;
  color: var(--clb-ink);
  letter-spacing: .2px;
}

/* ----- Accessibilité ----- */
.clb-skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--clb-ink); color: #fff; padding: 10px 16px; z-index: 9999;
}
.clb-skip-link:focus { left: 8px; top: 8px; color: #fff; }
:focus-visible { outline: 3px solid var(--clb-saffron); outline-offset: 2px; }

/* =========================================================================
   Signature : motif khatam (étoile marocaine à 8 branches)
   ========================================================================= */
.clb-khatam {
  width: 34px; height: 34px; flex: 0 0 auto;
  color: var(--clb-saffron);
}
.clb-rule {
  display: flex; align-items: center; justify-content: center;
  gap: 16px; margin: 0 auto; max-width: 320px; color: var(--clb-clay);
}
.clb-rule::before, .clb-rule::after {
  content: ""; height: 1px; flex: 1;
  background: linear-gradient(90deg, transparent, var(--clb-line));
}
.clb-rule::after { background: linear-gradient(90deg, var(--clb-line), transparent); }

/* =========================================================================
   En-tête (codé dans le thème car Elementor gratuit n'a pas de Theme Builder)
   ========================================================================= */
.clb-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(178, 74, 46, .96); /* terre cuite */
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--clb-clay-dark);
}
/* Décale l'en-tête sticky sous la barre d'admin WordPress (desktop only) */
.admin-bar .clb-header { top: 32px; }
/* Sous 782px, la barre d'admin WP n'est plus fixe (elle défile) :
   l'en-tête sticky doit donc coller à 0, sinon un vide apparaît au scroll. */
@media screen and (max-width: 782px) {
  .admin-bar .clb-header { top: 0; }
}

/* Bannière d'accueil : tient dans la fenêtre, sans scroll pour la voir en entier */
.clb-hero {
  min-height: calc(100vh - var(--clb-header-h));
  display: flex; align-items: center;
}
@supports (height: 100svh) {
  .clb-hero { min-height: calc(100svh - var(--clb-header-h)); }
}
.admin-bar .clb-hero { min-height: calc(100vh - var(--clb-header-h) - 32px); }
@supports (height: 100svh) {
  .admin-bar .clb-hero { min-height: calc(100svh - var(--clb-header-h) - 32px); }
}
@media screen and (max-width: 782px) {
  .admin-bar .clb-hero { min-height: calc(100vh - var(--clb-header-h) - 46px); }
}
.clb-header__inner {
  max-width: var(--clb-maxw); margin: 0 auto; padding: 0 24px;
  min-height: var(--clb-header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.clb-brand { display: flex; align-items: center; gap: 12px; line-height: 1; }
.clb-brand__mark { width: 40px; height: 40px; color: #fff; }
.clb-brand__name {
  font-family: var(--clb-font-display);
  font-size: 26px; color: #fff; letter-spacing: .5px;
}
.clb-brand__tag {
  display: block; font-family: var(--clb-font-body);
  font-size: 11px; letter-spacing: 3px; text-transform: uppercase;
  color: var(--clb-saffron-soft); margin-top: 2px;
}

.clb-nav { display: flex; align-items: center; gap: 28px; }
.clb-menu { display: flex; align-items: center; gap: 26px; list-style: none; margin: 0; padding: 0; }
.clb-menu a {
  font-family: var(--clb-font-body); font-weight: 600; font-size: 15px;
  letter-spacing: .4px; color: #FFF7EE; position: relative; padding: 6px 0;
}
.clb-menu a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 0;
  background: var(--clb-saffron); transition: width .25s ease;
}
.clb-menu a:hover, .clb-menu .current-menu-item > a { color: var(--clb-saffron-soft); }
.clb-menu a:hover::after, .clb-menu .current-menu-item > a::after { width: 100%; }

.clb-header__cta {
  font-family: var(--clb-font-body); font-weight: 700; font-size: 14px;
  letter-spacing: .5px; padding: 11px 20px; border-radius: var(--clb-radius);
  background: var(--clb-ink); color: #fff !important;
  border: 1px solid var(--clb-ink);
  transition: background .2s ease, color .2s ease;
}
.clb-header__cta:hover { background: var(--clb-saffron); color: var(--clb-ink) !important; border-color: var(--clb-saffron); }

/* Burger mobile */
.clb-burger {
  display: none; border: 0; background: transparent; cursor: pointer;
  width: 44px; height: 44px; padding: 10px; color: #fff;
}
.clb-burger span { display: block; height: 2px; background: currentColor; margin: 5px 0; transition: .25s; }
.clb-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.clb-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.clb-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =========================================================================
   Pied de page
   ========================================================================= */
.clb-footer {
  background: var(--clb-ink); color: #E9DCC9; margin-top: 0;
}
.clb-footer__inner {
  max-width: var(--clb-maxw); margin: 0 auto; padding: 56px 24px 28px;
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px;
}
.clb-footer h4 {
  color: var(--clb-saffron-soft); font-size: 18px; margin: 0 0 14px;
  letter-spacing: .5px;
}
.clb-footer__brand .clb-brand__name { color: #fff; }
.clb-footer p, .clb-footer li { color: #C9B79C; font-size: 15px; }
.clb-footer ul { list-style: none; margin: 0; padding: 0; }
.clb-footer li { margin-bottom: 12px; display: flex; align-items: flex-start; gap: 10px; }
.clb-footer-icon { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; color: var(--clb-saffron); }
.clb-footer a { color: #E9DCC9; }
.clb-footer a:hover { color: var(--clb-saffron); }
.clb-footer__bottom {
  border-top: 1px solid rgba(255,255,255,.1); margin-top: 36px;
  padding-top: 22px; padding-bottom: 28px;
  text-align: center; font-size: 13px; color: #9C8A72;
}

/* =========================================================================
   Contenu Elementor : zones par défaut + page sans titre
   ========================================================================= */
.clb-site-main { min-height: 40vh; }
.clb-page-content { max-width: var(--clb-maxw); margin: 0 auto; padding: 48px 24px 72px; }
.clb-page-content h1.entry-title { font-size: clamp(34px, 5vw, 52px); margin: 0 0 24px; }


/* =========================================================================
   Contact Form 7 — thème Chez Lbena
   ========================================================================= */
.wpcf7 { width: 100%; }

/* Grille du formulaire */
.wpcf7 .clb-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 24px;
}
.wpcf7 .clb-form-grid .clb-field-full { grid-column: 1 / -1; }

/* Labels */
.wpcf7 label {
  display: flex; flex-direction: column; gap: 6px;
  font-family: var(--clb-font-body); font-weight: 600; font-size: 14px;
  letter-spacing: .3px; color: var(--clb-ink);
  margin-bottom: 18px;
}
.wpcf7 label span.wpcf7-form-control-wrap { display: block; }

/* Champs */
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 input[type="date"],
.wpcf7 textarea,
.wpcf7 select {
  width: 100%; padding: 11px 14px;
  border: 1px solid var(--clb-line);
  border-radius: var(--clb-radius);
  background: var(--clb-white);
  font-family: var(--clb-font-body); font-size: 15px;
  color: var(--clb-ink);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.wpcf7 input[type="text"]:focus,
.wpcf7 input[type="email"]:focus,
.wpcf7 input[type="tel"]:focus,
.wpcf7 textarea:focus {
  outline: none;
  border-color: var(--clb-clay);
  box-shadow: 0 0 0 3px rgba(178,74,46,.12);
}
.wpcf7 textarea { min-height: 130px; resize: vertical; }

/* Bouton submit */
.wpcf7 .wpcf7-submit {
  background: var(--clb-clay); color: #fff; border: 0; cursor: pointer;
  padding: 13px 32px; border-radius: var(--clb-radius);
  font-family: var(--clb-font-body); font-weight: 700; font-size: 15px;
  letter-spacing: .5px; transition: background .2s ease;
  margin-top: 4px;
}
.wpcf7 .wpcf7-submit:hover { background: var(--clb-clay-dark); }

/* Messages de retour */
.wpcf7-response-output {
  border-radius: var(--clb-radius) !important;
  font-size: 14px; margin-top: 16px !important;
}

/* Erreurs inline */
.wpcf7-not-valid-tip {
  font-size: 12px; color: var(--clb-clay); margin-top: 4px; display: block;
}

@media (max-width: 640px) {
  .wpcf7 .clb-form-grid { grid-template-columns: 1fr; }
}


/* =========================================================================
   Icônes réseaux sociaux (pied de page)
   ========================================================================= */
.clb-social {
  display: flex; gap: 14px; margin-top: 18px;
}
.clb-social a {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.18);
  color: #C9B79C; transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.clb-social a svg { width: 18px; height: 18px; }
.clb-social a:hover {
  color: var(--clb-saffron); border-color: var(--clb-saffron);
  background: rgba(224,161,46,.08);
}

/* =========================================================================
   Utilitaires repris dans les modèles Elementor (classes optionnelles)
   ========================================================================= */
.clb-eyebrow {
  font-family: var(--clb-font-body); font-weight: 700; letter-spacing: 3px;
  text-transform: uppercase; font-size: 13px; color: var(--clb-clay);
}

/* =========================================================================
   Responsive — navigation mobile
   ========================================================================= */
@media (max-width: 880px) {
  .clb-header__inner { padding: 0 18px; gap: 12px; }
  .clb-brand__name { font-size: 22px; }
  .clb-brand__mark { width: 34px; height: 34px; }

  .clb-burger { display: block; }

  /* Panneau déroulant : caché par défaut, masqué proprement hors écran */
  .clb-nav {
    position: fixed;
    top: var(--clb-header-h);
    left: 0;
    right: 0;
    background: var(--clb-clay);
    border-bottom: 1px solid var(--clb-clay-dark);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0;
    box-shadow: var(--clb-shadow);
    /* caché */
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: max-height .3s ease, opacity .25s ease, visibility .25s ease;
  }
  /* Admin bar on mobile: WP admin bar is 46px tall but is NOT fixed at mobile widths,
     so the sticky nav must sit flush at the top of the viewport — no extra offset. */
  .admin-bar .clb-nav { top: var(--clb-header-h); }

  .clb-nav.is-open {
    max-height: calc(100vh - var(--clb-header-h));
    overflow-y: auto;
    opacity: 1;
    visibility: visible;
  }

  .clb-menu { flex-direction: column; align-items: stretch; gap: 0; width: 100%; }
  .clb-menu a {
    display: block;
    padding: 16px 24px;
    font-size: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, .14);
  }
  .clb-menu a::after { display: none; }

  .clb-header__cta {
    display: block;
    margin: 16px 24px 20px;
    text-align: center;
    background: var(--clb-ink);
  }

  .clb-footer__inner { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 400px) {
  .clb-brand__tag { display: none; }
}

/* =========================================================================
   Ajustements espacement mobile — padding uniquement, rien d'autre touché
   ========================================================================= */
@media (max-width: 767px) {
  /* Spacers Elementor : valeur contrôlée via space_mobile dans le JSON */
  .elementor-widget-image { margin-bottom: 0 !important; }
  .elementor-widget-image figure,
  .elementor-widget-image img { margin: 0 !important; }
  /* Exception : vignettes « Nos spécialités » conservent l'écart sous l'image */
  .clb-dish-img.elementor-widget-image img { margin-bottom: 30px !important; }
}

/* =========================================================================
   Carte / Menu (utilisé par le modèle Elementor « Menu »)
   ========================================================================= */
.clb-menu-list { list-style: none; margin: 0; padding: 0; }
.clb-menu-item { padding: 14px 0; border-bottom: 1px dashed var(--clb-line); }
.clb-menu-item:last-child { border-bottom: 0; }
.clb-menu-item__head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 14px;
}
.clb-menu-item__name {
  font-family: var(--clb-font-display); font-size: 20px; color: var(--clb-ink);
}
.clb-menu-item__price {
  font-family: var(--clb-font-body); font-weight: 700; color: var(--clb-clay);
  white-space: nowrap; font-size: 17px;
}
.clb-menu-item__desc { margin: 4px 0 0; color: var(--clb-ink-soft); font-size: 15px; }
.clb-menu-cat__title {
  font-family: var(--clb-font-display); font-size: 28px; color: var(--clb-green-dark);
  margin: 0 0 6px; display: flex; align-items: center; gap: 10px;
}
.clb-menu-cat__title::before { content: "✦"; color: var(--clb-saffron); }

/* Gouttière entre les 2 colonnes du menu — desktop uniquement */
.clb-gutter-left  { padding-left: 40px; }
.clb-gutter-right { padding-right: 40px; }
@media (max-width: 1024px) {
  .clb-gutter-left  { padding-left: 0; }
  .clb-gutter-right { padding-right: 0; }
}

/* Menu — flux 2 colonnes équilibrées (masonry), sans espace mort au milieu */
.clb-menu-flow { column-count: 2; column-gap: 40px; }
.clb-menu-flow .clb-menu-cat { break-inside: avoid; margin-bottom: 40px; }
.clb-menu-flow .clb-menu-cat:last-child { margin-bottom: 0; }
.clb-menu-flow .clb-col-break { break-before: column; }
@media (max-width: 767px) { .clb-menu-flow { column-count: 1; } }


/* Nos spécialités — vignettes plat carrées (recadrage cover) */
.clb-dish-img .elementor-widget-container { line-height: 0; }
.clb-dish-img img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
  display: block;
  margin-bottom: 16px;
}
/* Titre plat — supprime l'écart Elementor sous le titre (desktop + mobile) */
.titre-specialites { margin-bottom: 0 !important; }

/* Logo — détachement du fond terre cuite (ombre portée sur la forme) */
.clb-brand__mark { filter: drop-shadow(0 2px 3px rgba(0,0,0,0.38)); }
