/* Maudimi V50 - distribution ready polish.
   Final layer: menu cleanup, Gutenberg parity, SEO content readability, mobile/desktop ergonomics. */

:root {
  --mdm-v50-focus: #ffe08d;
  --mdm-v50-ink: #100806;
  --mdm-v50-paper: #fff7e8;
  --mdm-v50-paper-2: #eedbbd;
  --mdm-v50-night: #050302;
  --mdm-v50-panel: #17100b;
  --mdm-v50-line: rgba(226, 184, 102, .34);
}

body.maudimi-fse-v50 {
  text-rendering: optimizeLegibility;
}

body.maudimi-fse-v50 :where(a, button, input, textarea, select, summary):focus-visible {
  outline: 3px solid var(--mdm-v50-focus) !important;
  outline-offset: 4px !important;
}

.maudimi-button,
.wp-block-button__link,
.wp-element-button,
.mdm-nav-cta-v46 a {
  border-radius: 14px !important;
}

/* Menu: remove inherited decorative rings and keep one clean rectangular control. */
.maudimi-fse-v50.maudimi-companion-active .mdm-mobile-toggle-v46,
.maudimi-fse-v50.maudimi-companion-active .mdm-mobile-drawer-v46,
.maudimi-fse-v50.maudimi-safe-mobile-menu .mdm-mobile-toggle-v46,
.maudimi-fse-v50.maudimi-safe-mobile-menu .mdm-mobile-drawer-v46 {
  display: none !important;
}

@media (max-width: 1080px) {
  .maudimi-fse-v50 .mdm-header-v46 {
    min-height: 70px !important;
    border-bottom-color: rgba(226, 184, 102, .24) !important;
  }

  .maudimi-fse-v50 .mdm-global-mobile-toggle-v48 {
    position: fixed !important;
    top: calc(env(safe-area-inset-top, 0px) + .7rem) !important;
    right: .82rem !important;
    z-index: 100004 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: .62rem !important;
    min-width: 126px !important;
    min-height: 48px !important;
    padding: .68rem .98rem !important;
    border: 1px solid rgba(255, 226, 151, .54) !important;
    border-radius: 16px !important;
    background: linear-gradient(135deg, #ffe7a7 0%, #e8bd69 58%, #c99043 100%) !important;
    color: #120805 !important;
    box-shadow: 0 14px 32px rgba(0, 0, 0, .24), inset 0 1px 0 rgba(255, 255, 255, .45) !important;
    overflow: hidden !important;
    isolation: isolate !important;
    transform: none !important;
  }

  .maudimi-fse-v50 .mdm-global-mobile-toggle-v48::before,
  .maudimi-fse-v50 .mdm-global-mobile-toggle-v48::after,
  .maudimi-fse-v50 .mdm-global-mobile-toggle-v48 i::before,
  .maudimi-fse-v50 .mdm-global-mobile-toggle-v48 i::after,
  .maudimi-fse-v50 .mdm-global-mode-mobile-v49::before,
  .maudimi-fse-v50 .mdm-global-mode-mobile-v49::after {
    content: none !important;
    display: none !important;
  }

  .maudimi-fse-v50 .mdm-global-mobile-toggle-v48 i {
    flex: 0 0 22px !important;
    width: 22px !important;
    height: 16px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background:
      linear-gradient(currentColor, currentColor) 0 1px / 22px 2px no-repeat,
      linear-gradient(currentColor, currentColor) 0 7px / 22px 2px no-repeat,
      linear-gradient(currentColor, currentColor) 0 13px / 22px 2px no-repeat !important;
    box-shadow: none !important;
  }

  .maudimi-fse-v50 .mdm-global-mobile-toggle-v48 span {
    position: relative !important;
    z-index: 1 !important;
    display: inline-block !important;
    color: #120805 !important;
    font-size: .86rem !important;
    font-weight: 950 !important;
    letter-spacing: .12em !important;
    line-height: 1 !important;
    text-transform: uppercase !important;
  }

  .maudimi-fse-v50 .mdm-global-mobile-toggle-v48[aria-expanded="true"] {
    border-radius: 16px !important;
    background: linear-gradient(135deg, #f5d37b 0%, #d39a45 100%) !important;
    box-shadow: 0 10px 26px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .35) !important;
  }

  .maudimi-fse-v50 .mdm-global-mode-mobile-v49 {
    border-radius: 14px !important;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .24) !important;
    overflow: hidden !important;
  }

  .maudimi-fse-v50 .mdm-global-drawer-v48__panel {
    border-left: 1px solid rgba(226, 184, 102, .32) !important;
    background: linear-gradient(150deg, rgba(24, 15, 9, .98), rgba(5, 3, 2, .99) 76%) !important;
  }

  .maudimi-fse-v50 .mdm-global-drawer-v48__links a {
    min-height: 68px !important;
    border-radius: 14px !important;
  }
}

@media (max-width: 430px) {
  .maudimi-fse-v50 .mdm-global-mobile-toggle-v48 {
    min-width: 112px !important;
    right: .72rem !important;
    padding-inline: .82rem !important;
  }

  .maudimi-fse-v50 .mdm-global-mobile-toggle-v48 span {
    font-size: .78rem !important;
  }
}

/* Homepage: keep the cinematic opening, but do not turn the site into a tunnel. */
.maudimi-fse-v50 .maudimi-scroll-entry-v48 {
  min-height: clamp(720px, 112svh, 980px) !important;
}

.maudimi-fse-v50 .maudimi-scroll-entry-v48__copy p {
  color: rgba(255, 242, 220, .88) !important;
}

.maudimi-fse-v50 .maudimi-scroll-entry-v48__doors a {
  border-color: rgba(226, 184, 102, .34) !important;
}

.maudimi-fse-v50 .maudimi-interior-rubriques-v48 {
  min-height: auto !important;
}

@media (min-width: 781px) {
  .maudimi-fse-v50 .maudimi-door-grid-v48,
  .maudimi-fse-v50 .maudimi-enter-grid-v28,
  .maudimi-fse-v50 .maudimi-enter-grid-v26 {
    align-items: stretch !important;
  }

  .maudimi-fse-v50 .maudimi-door-card-v48,
  .maudimi-fse-v50 .maudimi-path-card-v28,
  .maudimi-fse-v50 .maudimi-path-card-v26 {
    height: 100% !important;
  }
}

/* Article cards: stable symmetry in real pages and editor. */
.maudimi-fse-v50 .maudimi-card-v32,
.maudimi-fse-v50 .wp-block-post-template > .wp-block-post {
  display: flex !important;
  flex-direction: column !important;
}

.maudimi-fse-v50 .maudimi-card-v32 .mdm-card-body {
  min-height: clamp(320px, 24vw, 420px) !important;
}

.maudimi-fse-v50 .maudimi-card-v32 .wp-block-post-excerpt {
  color: #5e4a37 !important;
}

.maudimi-fse-v50 .maudimi-card-v32 .wp-block-read-more {
  margin-top: auto !important;
  align-self: flex-start !important;
  color: #963f2e !important;
  font-weight: 850 !important;
}

html.maudimi-mode-light .maudimi-fse-v50 .maudimi-latest-section-v28,
html.maudimi-mode-auto.maudimi-system-light .maudimi-fse-v50 .maudimi-latest-section-v28,
body.maudimi-theme-light.maudimi-fse-v50 .maudimi-latest-section-v28 {
  background: linear-gradient(180deg, #ead8ba, #f2e3cb) !important;
}

html.maudimi-mode-light .maudimi-fse-v50 .maudimi-latest-section-v28 :where(h1,h2,h3,p,a,span),
html.maudimi-mode-auto.maudimi-system-light .maudimi-fse-v50 .maudimi-latest-section-v28 :where(h1,h2,h3,p,a,span),
body.maudimi-theme-light.maudimi-fse-v50 .maudimi-latest-section-v28 :where(h1,h2,h3,p,a,span) {
  color: #160b06 !important;
  text-shadow: none !important;
}

html.maudimi-mode-light .maudimi-fse-v50 .mdm-footer-v41,
html.maudimi-mode-auto.maudimi-system-light .maudimi-fse-v50 .mdm-footer-v41,
body.maudimi-theme-light.maudimi-fse-v50 .mdm-footer-v41 {
  background: linear-gradient(180deg, #f2e3cb, #ead6b5) !important;
}

html.maudimi-mode-light .maudimi-fse-v50 .mdm-footer-v41 :where(h2,h3,p,li,a,span),
html.maudimi-mode-auto.maudimi-system-light .maudimi-fse-v50 .mdm-footer-v41 :where(h2,h3,p,li,a,span),
body.maudimi-theme-light.maudimi-fse-v50 .mdm-footer-v41 :where(h2,h3,p,li,a,span) {
  color: #24170e !important;
}

/* Gutenberg parity: the editor should look close to the public site without blocking edition. */
.editor-styles-wrapper .maudimi-fse-v50,
.editor-styles-wrapper {
  color: #24170e;
}

.editor-styles-wrapper .maudimi-scroll-entry-v48 {
  min-height: 560px !important;
  outline: 1px dashed rgba(154, 76, 54, .24);
}

.editor-styles-wrapper .maudimi-scroll-entry-v48__sticky {
  position: relative !important;
  min-height: 560px !important;
  overflow: hidden !important;
}

.editor-styles-wrapper .maudimi-scroll-entry-v48__copy,
.editor-styles-wrapper .maudimi-scroll-entry-v48__doors {
  opacity: 1 !important;
  transform: none !important;
  pointer-events: auto !important;
}

.editor-styles-wrapper .mdm-global-mode-mobile-v49,
.editor-styles-wrapper .mdm-global-mobile-toggle-v48,
.editor-styles-wrapper .mdm-global-drawer-v48,
.editor-styles-wrapper .mdm-mobile-toggle-v46,
.editor-styles-wrapper .mdm-mobile-drawer-v46 {
  display: none !important;
}

.editor-styles-wrapper .maudimi-card-v32 .mdm-card-body {
  min-height: 300px !important;
}

@media (max-width: 780px) {
  .maudimi-fse-v50 .maudimi-scroll-entry-v48 {
    min-height: auto !important;
  }

  .maudimi-fse-v50 .maudimi-scroll-entry-v48__sticky {
    padding-top: calc(env(safe-area-inset-top, 0px) + 5.6rem) !important;
  }

  .maudimi-fse-v50 .maudimi-scroll-entry-v48__copy h1 {
    font-size: clamp(2.35rem, 10vw, 3.45rem) !important;
  }

  .maudimi-fse-v50 .maudimi-card-v32 .mdm-card-body {
    min-height: auto !important;
  }

  .maudimi-fse-v50 .maudimi-card-v32 .wp-block-post-title {
    font-size: clamp(1.75rem, 8.6vw, 2.55rem) !important;
    line-height: .98 !important;
  }
}
