/**
 * MASTRAT Child Theme - Clean stylesheet
 * Optimized for Elementor Pro pages.
 * Date: 2026-05-21
 */

:root {
    --mastrat-navy: #0E1F44;
    --mastrat-navy-dark: #0a1530;
    --mastrat-gold: #C9A961;
    --mastrat-gold-light: #d4b46c;
    --mastrat-text-soft: #475569;
}

/* Inter font for the whole site */
body, button, input, select, textarea {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Hide native WP elements we don't want */
body.elementor-page .page-title,
body.elementor-page .post-title,
body.elementor-page .entry-title {
    display: none;
}

/* =====================================================
   CUSTOM HEADER MASTRAT
   ===================================================== */

.mastrat-header {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.mastrat-header__inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px clamp(20px, 4vw, 48px);
    gap: 24px;
}

.mastrat-header__logo {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
}

.mastrat-header__logo img {
    height: 44px;
    width: auto;
    display: block;
}

@media (min-width: 1024px) {
    .mastrat-header__logo img {
        height: 56px;
    }
}

.mastrat-header__nav {
    display: flex;
    align-items: center;
    gap: 24px;
    flex: 1;
    justify-content: flex-end;
}

.mastrat-header__nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.mastrat-header__nav li {
    position: relative;
}

.mastrat-header__nav a {
    display: block;
    padding: 8px 12px;
    color: var(--mastrat-navy);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    border-radius: 6px;
    transition: background-color .2s ease, color .2s ease;
}

.mastrat-header__nav a:hover,
.mastrat-header__nav .current-menu-item > a {
    background: rgba(14, 31, 68, 0.06);
}

/* Sub-menu */
.mastrat-header__nav .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px;
    min-width: 220px;
    box-shadow: 0 10px 30px rgba(14, 31, 68, 0.08);
    display: none;
    flex-direction: column;
    gap: 2px;
    list-style: none;
    margin: 0;
}

.mastrat-header__nav li:hover > .sub-menu {
    display: flex;
}

.mastrat-header .mastrat-header__cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    background: var(--mastrat-navy);
    color: #ffffff;
    text-decoration: none;
    border-radius: 999px;
    font-weight: 600;
    font-size: 13.5px;
    letter-spacing: 0.01em;
    line-height: 1.3;
    border: 1px solid var(--mastrat-navy);
    box-shadow: 0 1px 2px rgba(14,31,68,0.08);
    transition: background .25s ease, color .25s ease, border-color .25s ease, box-shadow .25s ease, transform .15s ease;
    white-space: nowrap;
}

.mastrat-header .mastrat-header__cta::after {
    content: '→';
    display: inline-block;
    font-weight: 500;
    transition: transform .25s ease;
}

.mastrat-header .mastrat-header__cta:hover {
    background: var(--mastrat-gold);
    border-color: var(--mastrat-gold);
    color: var(--mastrat-navy);
    box-shadow: 0 4px 14px rgba(201,169,97,0.35);
    transform: translateY(-1px);
}

.mastrat-header .mastrat-header__cta:hover::after {
    transform: translateX(3px);
}

@media (max-width: 1080px) {
    .mastrat-header .mastrat-header__cta {
        padding: 8px 14px;
        font-size: 13px;
    }
}

.mastrat-header__toggle {
    display: none;
    background: none;
    border: none;
    padding: 10px;
    cursor: pointer;
    width: 44px;
    height: 44px;
    position: relative;
    z-index: 1001;
}

.mastrat-header__toggle-bar {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--mastrat-navy);
    border-radius: 2px;
    margin: 5px auto;
    transition: transform .3s ease, opacity .25s ease, background .3s ease;
    transform-origin: center;
}

.mastrat-header__toggle[aria-expanded="true"] .mastrat-header__toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.mastrat-header__toggle[aria-expanded="true"] .mastrat-header__toggle-bar:nth-child(2) {
    opacity: 0;
}
.mastrat-header__toggle[aria-expanded="true"] .mastrat-header__toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 1100px) {
    .mastrat-header__nav ul.mastrat-menu {
        display: none;
    }
    .mastrat-header__cta {
        display: none;
    }
    .mastrat-header__toggle {
        display: inline-block;
    }
    .mastrat-header__nav.is-open {
        display: block;
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        bottom: 0;
        background: #ffffff;
        overflow-y: auto;
        z-index: 1000;
        box-shadow: 0 8px 24px rgba(14,31,68,0.08);
    }
    .mastrat-header__nav.is-open ul.mastrat-menu {
        display: flex;
        flex-direction: column;
        padding: 16px 20px 24px;
        gap: 0;
        list-style: none;
        margin: 0;
    }
    .mastrat-header__nav.is-open ul.mastrat-menu > li {
        border-bottom: 1px solid #f1f5f9;
    }
    .mastrat-header__nav.is-open ul.mastrat-menu > li:last-of-type {
        border-bottom: none;
    }
    .mastrat-header__nav.is-open ul.mastrat-menu > li > a {
        display: block;
        padding: 14px 4px;
        font-size: 16px;
        font-weight: 600;
        color: var(--mastrat-navy);
        text-decoration: none;
    }
    /* Parent avec sous-menu : afficher un chevron */
    .mastrat-header__nav.is-open ul.mastrat-menu > li.menu-item-has-children > a {
        position: relative;
        padding-right: 36px;
    }
    .mastrat-header__nav.is-open ul.mastrat-menu > li.menu-item-has-children > a::after {
        content: '';
        position: absolute;
        right: 8px;
        top: 50%;
        width: 8px;
        height: 8px;
        border-right: 2px solid var(--mastrat-gold);
        border-bottom: 2px solid var(--mastrat-gold);
        transform: translateY(-70%) rotate(45deg);
        transition: transform .3s ease;
    }
    .mastrat-header__nav.is-open ul.mastrat-menu > li.menu-item-has-children.is-open > a::after {
        transform: translateY(-30%) rotate(-135deg);
    }
    /* Sous-menus fermés par défaut */
    .mastrat-header__nav.is-open ul.mastrat-menu .sub-menu {
        display: none;
        list-style: none;
        margin: 0;
        padding: 0 0 12px 12px;
    }
    .mastrat-header__nav.is-open ul.mastrat-menu li.menu-item-has-children.is-open > .sub-menu {
        display: block;
    }
    .mastrat-header__nav.is-open ul.mastrat-menu .sub-menu a {
        display: block;
        padding: 10px 4px;
        font-size: 15px;
        color: #475569;
        text-decoration: none;
        font-weight: 500;
    }
    /* CTA mobile en bas du menu */
    .mastrat-header__nav.is-open .mastrat-header__cta {
        display: inline-block;
        margin: 20px 20px 24px;
        text-align: center;
        font-size: 15px;
        padding: 12px 20px;
    }
    body.mastrat-menu-open {
        overflow: hidden;
    }
}

/* =====================================================
   CUSTOM FOOTER MASTRAT
   ===================================================== */

.mastrat-footer {
    background: var(--mastrat-navy);
    color: rgba(255, 255, 255, 0.8);
    padding: 80px 0 0;
}

.mastrat-footer__inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 clamp(20px, 4vw, 48px);
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 56px;
    padding-bottom: 64px;
}

@media (max-width: 1100px) {
    .mastrat-footer__inner {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }
}

@media (max-width: 600px) {
    .mastrat-footer__inner {
        grid-template-columns: 1fr;
    }
}

.mastrat-footer__brand {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mastrat-footer__logo img {
    height: 44px;
    width: auto;
}

.mastrat-footer__tagline {
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    max-width: 280px;
}

.mastrat-footer__title {
    color: var(--mastrat-gold);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin: 0 0 16px;
}

.mastrat-footer__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mastrat-footer__list a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 14px;
    transition: color .2s ease;
}

.mastrat-footer__list a:hover {
    color: var(--mastrat-gold);
}

.mastrat-footer__bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 24px 0;
}

.mastrat-footer__bottom-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 clamp(20px, 4vw, 48px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.mastrat-footer__copyright {
    margin: 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

.mastrat-footer__legal {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 24px;
}

.mastrat-footer__legal a {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: 13px;
    transition: color .2s ease;
}

.mastrat-footer__legal a:hover {
    color: var(--mastrat-gold);
}

/* =====================================================
   FLUENT FORMS - MASTRAT STYLE
   ===================================================== */

.fluentform .ff-el-input--content input,
.fluentform .ff-el-input--content textarea,
.fluentform input[type="text"],
.fluentform input[type="email"],
.fluentform textarea {
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 6px !important;
    padding: 12px 16px !important;
    font-size: 15px !important;
    color: var(--mastrat-navy) !important;
    background: #ffffff !important;
    font-family: 'Inter', sans-serif !important;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.fluentform input[type="text"]:focus,
.fluentform input[type="email"]:focus,
.fluentform textarea:focus {
    border-color: var(--mastrat-gold) !important;
    box-shadow: 0 0 0 3px rgba(201, 169, 97, 0.15) !important;
    outline: none !important;
}

.fluentform .ff-el-input--label label {
    color: var(--mastrat-navy) !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    margin-bottom: 6px !important;
}

.fluentform button.ff-btn-submit,
.fluentform .ff-btn {
    background: var(--mastrat-navy) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    padding: 14px 32px !important;
    border-radius: 6px !important;
    border: none !important;
    cursor: pointer;
    font-family: 'Inter', sans-serif !important;
    transition: all .25s ease;
    text-decoration: none !important;
}

.fluentform button.ff-btn-submit:hover,
.fluentform .ff-btn:hover {
    background: var(--mastrat-gold) !important;
    color: var(--mastrat-navy) !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(201, 169, 97, 0.35);
}

/* =====================================================
   ACCESSIBILITY: focus visible
   ===================================================== */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--mastrat-gold);
    outline-offset: 3px;
    border-radius: 3px;
}

/* =====================================================
   SCROLLBAR
   ===================================================== */
html { scroll-behavior: smooth; }
/* MASTRAT — typography injection for blog article body */
.elementor-widget-theme-post-content .elementor-widget-container {
  font-size: 17px;
  line-height: 1.75;
  color: #1f2937;
}
.elementor-widget-theme-post-content p {
  margin: 0 0 22px;
  font-size: 17px;
  line-height: 1.75;
  color: #374151;
}
.elementor-widget-theme-post-content h2 {
  font-size: 28px !important;
  font-weight: 800 !important;
  color: #0E1F44 !important;
  line-height: 1.25 !important;
  letter-spacing: -0.015em !important;
  margin: 56px 0 20px !important;
}
.elementor-widget-theme-post-content h2:first-child {
  margin-top: 0 !important;
}
.elementor-widget-theme-post-content h3 {
  font-size: 21px !important;
  font-weight: 700 !important;
  color: #0E1F44 !important;
  line-height: 1.35 !important;
  margin: 36px 0 14px !important;
}
.elementor-widget-theme-post-content strong {
  color: #0E1F44;
  font-weight: 600;
}
.elementor-widget-theme-post-content em {
  color: #475569;
  font-style: italic;
}
.elementor-widget-theme-post-content a {
  color: #0E1F44;
  text-decoration: underline;
  text-decoration-color: rgba(201,169,97,0.5);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  font-weight: 500;
}
.elementor-widget-theme-post-content a:hover {
  text-decoration-color: #C9A961;
  text-decoration-thickness: 2px;
}

/* Lists */
.elementor-widget-theme-post-content ol,
.elementor-widget-theme-post-content ul {
  margin: 0 0 28px;
  padding-left: 24px;
}
.elementor-widget-theme-post-content li {
  margin-bottom: 10px;
  font-size: 17px;
  line-height: 1.7;
  color: #374151;
  padding-left: 4px;
}
.elementor-widget-theme-post-content ol > li::marker {
  color: #C9A961;
  font-weight: 700;
}

/* Tables */
.elementor-widget-theme-post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 36px 0;
  font-size: 15px;
}
.elementor-widget-theme-post-content th {
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #6b7280;
  padding: 12px 14px 12px 0;
  border-bottom: 2px solid #0E1F44;
}
.elementor-widget-theme-post-content td {
  padding: 16px 14px 16px 0;
  border-bottom: 1px solid #e5e7eb;
  color: #374151;
}

/* Blockquote */
.elementor-widget-theme-post-content blockquote {
  border-left: 3px solid #C9A961;
  padding: 4px 0 4px 24px;
  margin: 32px 0;
  font-style: italic;
  color: #475569;
  font-size: 18px;
}

/* Tighten Elementor widget vertical rhythm */
.elementor-section.elementor-section-boxed > .elementor-container {
  max-width: 100%;
}

/* Hide author avatars on posts cards (we use organization branding, not personal avatar) */
.elementor-post__avatar,
.elementor-post-avatar { display: none !important; }

/* =====================================================
   FIX HEADER MOBILE — override Elementor Kit (2026-05-28)
   - Elementor Kit force background-color #0E1F44 sur tous les <button>,
     ce qui rendait le burger = carré bleu plein avec barres invisibles.
   - Le CTA .mastrat-header__cta restait en display:inline-flex (sélecteur
     plus spécifique .mastrat-header .mastrat-header__cta) malgré le
     display:none du media query.
   ===================================================== */

/* Burger : fond toujours transparent, peu importe Elementor Kit */
.mastrat-header__toggle,
.mastrat-header .mastrat-header__toggle {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Barres du burger : forcer la couleur marine visible sur fond transparent */
.mastrat-header__toggle .mastrat-header__toggle-bar {
    background: var(--mastrat-navy) !important;
}

@media (max-width: 1100px) {
    /* CTA caché en mobile — bat .mastrat-header .mastrat-header__cta */
    .mastrat-header .mastrat-header__cta {
        display: none !important;
    }
    /* Sauf quand le menu mobile est ouvert : le CTA réapparaît en bas */
    .mastrat-header__nav.is-open .mastrat-header__cta {
        display: inline-block !important;
    }
    /* Burger visible et propre */
    .mastrat-header .mastrat-header__toggle {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
    }
}

/* FIX sous-menu mobile dans le flux (2026-05-28) — empêche le chevauchement */
@media (max-width: 1100px) {
    .mastrat-header__nav.is-open ul.mastrat-menu,
    .mastrat-header__nav.is-open ul.mastrat-menu .sub-menu {
        position: static !important;
        transform: none !important;
        box-shadow: none !important;
        width: auto !important;
        min-width: 0 !important;
    }
    /* le parent en colonne, le sous-menu pousse les items suivants */
    .mastrat-header__nav.is-open ul.mastrat-menu {
        display: flex !important;
        flex-direction: column !important;
    }
    .mastrat-header__nav.is-open ul.mastrat-menu > li {
        display: block !important;
        width: 100% !important;
    }
    .mastrat-header__nav.is-open ul.mastrat-menu li.menu-item-has-children.is-open > .sub-menu {
        display: block !important;
        position: static !important;
        background: #f8fafc;
        border-radius: 8px;
        margin-top: 4px;
    }
}

/* =====================================================
   FIX LAYOUT HEADER MOBILE (2026-05-28) — burger collé à droite
   Le nav avait flex:1 et poussait le burger au centre. En mobile, on
   retire le nav du flux et on colle le burger à droite via margin-left:auto.
   ===================================================== */
@media (max-width: 1100px) {
    .mastrat-header__inner {
        position: relative;
    }
    /* Burger toujours tout à droite, au-dessus du reste */
    .mastrat-header .mastrat-header__toggle {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        margin-left: auto;     /* colle à droite */
        order: 2;
        flex: 0 0 auto;
        background: transparent !important;
        border: none !important;
        z-index: 1002;
    }
    .mastrat-header__logo { order: 1; }
    /* Le nav fermé ne prend AUCUNE place dans le flux (sinon il pousse le burger) */
    .mastrat-header__nav:not(.is-open) {
        flex: 0 0 0;
        width: 0;
        overflow: hidden;
    }
}

/* =====================================================
   FIX TYPO HERO MOBILE (2026-05-28) — titre trop gros qui déborde
   ===================================================== */
@media (max-width: 767px) {
    /* Tous les gros titres Elementor passent à une taille mobile lisible */
    .elementor-widget-heading h1.elementor-heading-title,
    .elementor-widget-heading h2.elementor-heading-title {
        font-size: clamp(28px, 8vw, 38px) !important;
        line-height: 1.15 !important;
        word-break: normal !important;
        overflow-wrap: break-word !important;
        hyphens: none !important;
    }
    /* Sous-titres / H3 */
    .elementor-widget-heading h3.elementor-heading-title {
        font-size: clamp(22px, 6vw, 28px) !important;
        line-height: 1.2 !important;
    }
    /* Paragraphes hero pas trop larges */
    .elementor-widget-text-editor, .elementor-widget-heading {
        max-width: 100% !important;
    }
    /* Empêcher tout overflow horizontal global */
    .elementor-section, .e-con, .elementor-container {
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }
}

/* FIX FINAL barres du burger (2026-05-28) — width était à 0 = invisibles */
.mastrat-header__toggle .mastrat-header__toggle-bar {
    width: 26px !important;
    height: 2.5px !important;
    background: var(--mastrat-navy, #0E1F44) !important;
    display: block !important;
    margin: 5px auto !important;
    border-radius: 2px !important;
}

/* FIX burger flex column (2026-05-28) — les barres étaient compressées à 0
   car le toggle était en flex row. On empile verticalement. */
.mastrat-header .mastrat-header__toggle {
    flex-direction: column !important;
    gap: 5px;
}
.mastrat-header__toggle .mastrat-header__toggle-bar {
    flex: 0 0 auto !important;
    margin: 0 !important;
}

/* =====================================================
   FIX hauteur HERO mobile (2026-05-28)
   Le hero avait padding 120px/120px = 240px de padding + le titre + texte
   débordaient sous l écran. Tout le hero doit tenir dans la zone visible
   pour que le CTA "Réservez un RDV" soit immédiatement cliquable.
   ===================================================== */
@media (max-width: 767px) {
    /* Première section de la home (hero) : padding réduit */
    main > .elementor-section:first-of-type,
    main > .e-con:first-of-type,
    .elementor-section.elementor-top-section:first-of-type,
    body.home main .elementor-section:first-of-type {
        padding-top: 28px !important;
        padding-bottom: 32px !important;
        min-height: 0 !important;
    }
    /* Compacter le titre + texte + CTA dans le hero */
    main > .elementor-section:first-of-type .elementor-widget,
    main > .e-con:first-of-type .elementor-widget {
        margin-bottom: 12px !important;
    }
    /* L eyebrow (CABINET DE TRANSFORMATION) plus compact */
    main > .elementor-section:first-of-type h3.elementor-heading-title,
    main > .elementor-section:first-of-type h6.elementor-heading-title {
        font-size: 11px !important;
        letter-spacing: 0.15em;
        margin-bottom: 8px !important;
    }
    /* Le H1 titre principal : encore plus serré */
    main > .elementor-section:first-of-type h1.elementor-heading-title,
    main > .elementor-section:first-of-type h2.elementor-heading-title {
        font-size: 26px !important;
        line-height: 1.18 !important;
        margin-bottom: 12px !important;
    }
    /* Le sous-texte du hero : plus petit */
    main > .elementor-section:first-of-type .elementor-widget-text-editor p {
        font-size: 14px !important;
        line-height: 1.5 !important;
    }
    /* Le bouton CTA : pas de gros margin au-dessus */
    main > .elementor-section:first-of-type .elementor-widget-button {
        margin-top: 8px !important;
    }
}

/* Encore 7px à gagner pour rentrer le CTA */
@media (max-width: 767px) {
    main > .elementor-section:first-of-type,
    main > .e-con:first-of-type,
    .elementor-section.elementor-top-section:first-of-type,
    body.home main .elementor-section:first-of-type {
        padding-top: 18px !important;
        padding-bottom: 22px !important;
    }
    main > .elementor-section:first-of-type h1.elementor-heading-title,
    main > .elementor-section:first-of-type h2.elementor-heading-title {
        font-size: 24px !important;
        line-height: 1.15 !important;
    }
}
