/* Maudimi V49 - production display fixes.
   Purpose: readability, compact mobile homepage, clean mobile menu, light mode parity. */

:root {
  --mdm-v49-paper: #f6ead8;
  --mdm-v49-paper-soft: #efe0c7;
  --mdm-v49-ink: #100805;
  --mdm-v49-text: #231710;
  --mdm-v49-muted: #6c5540;
  --mdm-v49-gold: #e2b866;
  --mdm-v49-copper: #9a4c36;
  --mdm-v49-line: rgba(137, 84, 37, .32);
  --mdm-v49-night: #050302;
  --mdm-v49-panel: #18100b;
}

/* Safer light mode: no white text on beige, no washed footer/newsletter. */
html.maudimi-mode-light,
html.maudimi-mode-auto.maudimi-system-light,
body.maudimi-theme-light,
body.maudimi-theme-auto.maudimi-prefers-light {
  --mdm-bg: #f1e3cc !important;
  --mdm-bg-2: #ead9be !important;
  --mdm-panel: #fff8ec !important;
  --mdm-panel-2: #f3e1c4 !important;
  --mdm-title: #130905 !important;
  --mdm-text: #24170e !important;
  --mdm-muted: #654d38 !important;
  --mdm-soft: #7c5b3c !important;
  --mdm-accent: #96492f !important;
  --mdm-accent-2: #7a3b28 !important;
  --mdm-line: rgba(126, 75, 32, .28) !important;
  --mdm-line-strong: rgba(126, 75, 32, .48) !important;
}

html.maudimi-mode-light body,
html.maudimi-mode-auto.maudimi-system-light body,
body.maudimi-theme-light {
  background: #f1e3cc !important;
  color: #24170e !important;
}

html.maudimi-mode-light .maudimi-section,
html.maudimi-mode-auto.maudimi-system-light .maudimi-section,
body.maudimi-theme-light .maudimi-section,
body.maudimi-theme-auto.maudimi-prefers-light .maudimi-section,
html.maudimi-mode-light .mdm-section,
html.maudimi-mode-auto.maudimi-system-light .mdm-section,
body.maudimi-theme-light .mdm-section,
body.maudimi-theme-auto.maudimi-prefers-light .mdm-section,
html.maudimi-mode-light .maudimi-latest-section-v28,
html.maudimi-mode-auto.maudimi-system-light .maudimi-latest-section-v28,
body.maudimi-theme-light .maudimi-latest-section-v28,
body.maudimi-theme-auto.maudimi-prefers-light .maudimi-latest-section-v28,
html.maudimi-mode-light .mdm-footer-v41,
html.maudimi-mode-auto.maudimi-system-light .mdm-footer-v41,
body.maudimi-theme-light .mdm-footer-v41,
body.maudimi-theme-auto.maudimi-prefers-light .mdm-footer-v41 {
  background: linear-gradient(180deg, #f3e6d0, #ead7ba) !important;
  color: #24170e !important;
}

html.maudimi-mode-light .maudimi-section :is(h1,h2,h3,h4,p,li,a,small,strong,em,span),
html.maudimi-mode-auto.maudimi-system-light .maudimi-section :is(h1,h2,h3,h4,p,li,a,small,strong,em,span),
body.maudimi-theme-light .maudimi-section :is(h1,h2,h3,h4,p,li,a,small,strong,em,span),
body.maudimi-theme-auto.maudimi-prefers-light .maudimi-section :is(h1,h2,h3,h4,p,li,a,small,strong,em,span),
html.maudimi-mode-light .mdm-footer-v41 :is(h1,h2,h3,h4,p,li,a,small,strong,em,span),
html.maudimi-mode-auto.maudimi-system-light .mdm-footer-v41 :is(h1,h2,h3,h4,p,li,a,small,strong,em,span),
body.maudimi-theme-light .mdm-footer-v41 :is(h1,h2,h3,h4,p,li,a,small,strong,em,span),
body.maudimi-theme-auto.maudimi-prefers-light .mdm-footer-v41 :is(h1,h2,h3,h4,p,li,a,small,strong,em,span) {
  color: #24170e !important;
  text-shadow: none !important;
}

html.maudimi-mode-light .maudimi-kicker,
html.maudimi-mode-auto.maudimi-system-light .maudimi-kicker,
body.maudimi-theme-light .maudimi-kicker,
body.maudimi-theme-auto.maudimi-prefers-light .maudimi-kicker,
html.maudimi-mode-light .mdm-kicker,
html.maudimi-mode-auto.maudimi-system-light .mdm-kicker,
body.maudimi-theme-light .mdm-kicker,
body.maudimi-theme-auto.maudimi-prefers-light .mdm-kicker {
  color: #8e4b2f !important;
}

/* Homepage: cinematic entry, but no endless scroll. */
.maudimi-scroll-entry-v48 {
  min-height: 145svh !important;
}

.maudimi-scroll-entry-v48__copy h1 {
  max-width: 12.5ch !important;
}

.maudimi-scroll-entry-v48__doors a,
.maudimi-door-card-v48,
.maudimi-path-card-v28,
.maudimi-path-card-v26 {
  border-radius: 16px !important;
}

.maudimi-interior-rubriques-v48 {
  min-height: 620px !important;
}

.maudimi-section,
.mdm-section,
.wp-site-blocks > .wp-block-group.alignfull:not(.mdm-header) {
  padding-block: clamp(3.2rem, 5.5vw, 5.75rem) !important;
}

.maudimi-why-v28 {
  display: none !important;
}

/* Hide older oval entry widgets: they felt decorative and cheap. */
.maudimi-entry-portal-v46,
.maudimi-entry-portal-v44,
.maudimi-entry-portal-v43 {
  display: none !important;
}

/* Mobile header and mode controls. */
@media (max-width: 1080px) {
  .mdm-header-v46 {
    position: sticky !important;
    top: 0 !important;
    z-index: 100000 !important;
    min-height: 72px !important;
    padding: .72rem 1rem !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
  }

  .mdm-brand-baseline {
    display: none !important;
  }

  .mdm-global-mobile-toggle-v48 {
    top: calc(env(safe-area-inset-top, 0px) + .72rem) !important;
    right: .85rem !important;
    min-height: 48px !important;
    padding: .68rem 1rem !important;
    border-radius: 18px !important;
    background: linear-gradient(135deg, #ffe59f, #d7a75b) !important;
    color: #130805 !important;
    box-shadow: 0 12px 34px rgba(215, 167, 91, .20) !important;
  }

  .mdm-global-mode-mobile-v49 {
    position: fixed !important;
    top: calc(env(safe-area-inset-top, 0px) + .78rem) !important;
    right: calc(.85rem + 128px) !important;
    z-index: 100002 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: .18rem !important;
    min-height: 44px !important;
    padding: .25rem !important;
    border: 1px solid rgba(226, 184, 102, .38) !important;
    border-radius: 16px !important;
    background: rgba(15, 9, 6, .82) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
  }

  .mdm-global-mode-mobile-v49 button {
    min-width: 38px !important;
    min-height: 34px !important;
    border: 0 !important;
    border-radius: 12px !important;
    background: transparent !important;
    color: #ead4b2 !important;
    font-size: .72rem !important;
    font-weight: 900 !important;
    text-transform: uppercase !important;
  }

  .mdm-global-mode-mobile-v49 button[aria-pressed="true"] {
    background: linear-gradient(135deg, #ffe59f, #d7a75b) !important;
    color: #130805 !important;
  }
}

@media (max-width: 430px) {
  .mdm-global-mode-mobile-v49 {
    right: calc(.75rem + 116px) !important;
  }

  .mdm-global-mode-mobile-v49 button {
    min-width: 32px !important;
    font-size: .68rem !important;
  }
}

@media (min-width: 1081px) {
  .mdm-global-mode-mobile-v49 {
    display: none !important;
  }
}

/* Mobile drawer: cleaner rows, no broken glyphs, less pill-heavy. */
.mdm-global-drawer-v48__panel {
  background: linear-gradient(150deg, #160d08, #050302 74%) !important;
}

.mdm-global-drawer-v48__links {
  gap: .6rem !important;
}

.mdm-global-drawer-v48__links a {
  grid-template-columns: 34px 1fr !important;
  min-height: 64px !important;
  padding: .82rem .9rem !important;
  border-radius: 14px !important;
  border-color: rgba(226, 184, 102, .30) !important;
  background: linear-gradient(90deg, rgba(255, 244, 221, .075), rgba(255, 244, 221, .035)) !important;
}

.mdm-global-drawer-v48__links a::before {
  width: 34px !important;
  height: 34px !important;
  border-radius: 10px !important;
  background: rgba(226, 184, 102, .13) !important;
  color: #f5cf77 !important;
  font-size: .76rem !important;
  font-weight: 950 !important;
}

.mdm-global-drawer-v48__links strong {
  letter-spacing: .04em !important;
}

.mdm-global-drawer-v48__mode {
  margin-top: .2rem !important;
  padding-top: .8rem !important;
  border-top: 1px solid rgba(226, 184, 102, .18) !important;
}

.mdm-global-drawer-v48__mode .mdm-mode-switch-v46 {
  display: flex !important;
  width: 100% !important;
  justify-content: center !important;
}

/* Mobile homepage: immediate comprehension, no five-scroll intro. */
@media (max-width: 780px) {
  .maudimi-scroll-entry-v48 {
    min-height: auto !important;
  }

  .maudimi-scroll-entry-v48__sticky {
    position: relative !important;
    min-height: auto !important;
    display: block !important;
    padding: 6.2rem .85rem 2.4rem !important;
  }

  .maudimi-scroll-entry-v48__building {
    position: absolute !important;
    transform: scale(1.06) !important;
    filter: saturate(.94) contrast(1.08) brightness(.62) !important;
  }

  .maudimi-scroll-entry-v48__veil {
    background:
      linear-gradient(180deg, rgba(5,3,2,.72), rgba(5,3,2,.48) 40%, rgba(5,3,2,.88)),
      radial-gradient(circle at 50% 34%, rgba(226,184,102,.10), transparent 15rem) !important;
  }

  .maudimi-scroll-entry-v48__doorline {
    display: none !important;
  }

  .maudimi-scroll-entry-v48__content {
    width: 100% !important;
    min-height: auto !important;
    padding: 0 !important;
    display: grid !important;
    gap: 1rem !important;
  }

  .maudimi-scroll-entry-v48__copy,
  .maudimi-scroll-entry-v48.is-past-threshold .maudimi-scroll-entry-v48__copy {
    opacity: 1 !important;
    transform: none !important;
    padding: 1rem !important;
    border: 1px solid rgba(226,184,102,.28) !important;
    border-radius: 18px !important;
    background: rgba(5, 3, 2, .62) !important;
    box-shadow: 0 20px 58px rgba(0,0,0,.28) !important;
  }

  .maudimi-scroll-entry-v48__copy h1 {
    max-width: 12ch !important;
    font-size: clamp(2.55rem, 11.5vw, 3.85rem) !important;
    line-height: .96 !important;
  }

  .maudimi-scroll-entry-v48__copy p {
    font-size: 1rem !important;
    line-height: 1.5 !important;
  }

  .maudimi-scroll-entry-v48__actions {
    gap: .55rem !important;
  }

  .maudimi-button-primary-v48,
  .maudimi-button-secondary-v48 {
    min-height: 44px !important;
    padding: .72rem .9rem !important;
    border-radius: 14px !important;
    font-size: .82rem !important;
  }

  .maudimi-scroll-entry-v48__doors,
  .maudimi-scroll-entry-v48.is-past-threshold .maudimi-scroll-entry-v48__doors {
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
    width: 100% !important;
    padding: .7rem !important;
    border-radius: 16px !important;
  }

  .maudimi-scroll-entry-v48__doors a {
    min-height: 58px !important;
    grid-template-columns: 34px 1fr !important;
    padding: .64rem !important;
    border-radius: 13px !important;
  }

  .maudimi-scroll-entry-v48__doors span {
    width: 34px !important;
    height: 34px !important;
    border-radius: 10px !important;
    font-size: .76rem !important;
  }

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

  .maudimi-interior-rubriques-v48__inner {
    padding-block: 2.4rem !important;
  }

  .maudimi-door-grid-v48 {
    gap: .72rem !important;
  }

  .maudimi-door-card-v48 {
    min-height: 0 !important;
    padding: .92rem !important;
    border-radius: 14px !important;
  }

  .maudimi-door-card-v48 strong {
    margin: .46rem 0 .35rem !important;
    font-size: 1.18rem !important;
  }

  .maudimi-section,
  .mdm-section,
  .wp-site-blocks > .wp-block-group.alignfull:not(.mdm-header) {
    padding-block: 2.5rem !important;
  }

  .maudimi-page-hero-v41,
  .maudimi-hero-v41,
  .maudimi-page-hero,
  .maudimi-hero-v28,
  .maudimi-hero-v30 {
    min-height: auto !important;
    padding-block: 6rem 2.6rem !important;
  }

  .maudimi-page-hero-v41 .wp-block-cover__inner-container,
  .maudimi-hero-v41 .wp-block-cover__inner-container {
    width: 100% !important;
  }

  .maudimi-hero-copy-v41,
  .maudimi-hero-copy-v28 {
    margin-inline: .85rem !important;
    max-width: calc(100vw - 1.7rem) !important;
  }

  .maudimi-hero-copy-v41 h1,
  .maudimi-hero-copy-v28 h1,
  .maudimi-page-hero h1 {
    font-size: clamp(2.35rem, 10.5vw, 3.65rem) !important;
    line-height: .98 !important;
  }
}

/* Article cards: equal rhythm, fallback visual when an article has no featured image. */
.maudimi-latest-v28 .wp-block-post-template,
.maudimi-archive-query-v26 .wp-block-post-template {
  align-items: stretch !important;
}

.maudimi-card-v32,
.maudimi-latest-v28 .wp-block-post-template .wp-block-post,
.maudimi-archive-query-v26 .wp-block-post-template .wp-block-post {
  height: 100% !important;
  min-height: 0 !important;
}

.maudimi-card-v32 .wp-block-post-featured-image,
.maudimi-card-v32 .wp-block-post-featured-image a,
.maudimi-card-v32 .wp-block-post-featured-image img {
  display: block !important;
  width: 100% !important;
}

.maudimi-card-v32 .wp-block-post-featured-image img {
  aspect-ratio: 16 / 9 !important;
  object-fit: cover !important;
  filter: brightness(.78) contrast(1.08) saturate(.94) !important;
}

@supports selector(.maudimi-card-v32:has(img)) {
  .maudimi-card-v32::before {
    content: "" !important;
    display: block !important;
    aspect-ratio: 16 / 9 !important;
    width: 100% !important;
    background: linear-gradient(180deg, rgba(5,3,2,.18), rgba(5,3,2,.54)), url("../images/fallback/fallback-card.webp") center / cover no-repeat !important;
  }

  .maudimi-card-v32:has(.wp-block-post-featured-image img)::before {
    display: none !important;
  }
}

.maudimi-card-v32 .mdm-card-body {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
}

html.maudimi-mode-light .maudimi-card-v32 .mdm-card-body,
html.maudimi-mode-auto.maudimi-system-light .maudimi-card-v32 .mdm-card-body,
body.maudimi-theme-light .maudimi-card-v32 .mdm-card-body,
body.maudimi-theme-auto.maudimi-prefers-light .maudimi-card-v32 .mdm-card-body {
  background: linear-gradient(145deg, #fff8ec, #f0dfc4) !important;
  color: #24170e !important;
}

html.maudimi-mode-light .maudimi-card-v32 .mdm-card-body :is(h1,h2,h3,p,a,span,time,div),
html.maudimi-mode-auto.maudimi-system-light .maudimi-card-v32 .mdm-card-body :is(h1,h2,h3,p,a,span,time,div),
body.maudimi-theme-light .maudimi-card-v32 .mdm-card-body :is(h1,h2,h3,p,a,span,time,div),
body.maudimi-theme-auto.maudimi-prefers-light .maudimi-card-v32 .mdm-card-body :is(h1,h2,h3,p,a,span,time,div) {
  color: #24170e !important;
}

html.maudimi-mode-light .maudimi-card-v32 .wp-block-read-more,
html.maudimi-mode-auto.maudimi-system-light .maudimi-card-v32 .wp-block-read-more,
body.maudimi-theme-light .maudimi-card-v32 .wp-block-read-more,
body.maudimi-theme-auto.maudimi-prefers-light .maudimi-card-v32 .wp-block-read-more {
  color: #8e3f2d !important;
}

@media (max-width: 780px) {
  .maudimi-latest-v28 .wp-block-post-template,
  .maudimi-archive-query-v26 .wp-block-post-template {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  .maudimi-card-v32,
  .maudimi-latest-v28 .wp-block-post-template .wp-block-post,
  .maudimi-archive-query-v26 .wp-block-post-template .wp-block-post {
    border-radius: 18px !important;
  }

  .maudimi-card-v32 .mdm-card-body {
    padding: 1rem !important;
  }
}

/* Gutenberg: show the public spacing and compact behavior in the editor. */
.editor-styles-wrapper .maudimi-scroll-entry-v48 {
  min-height: auto !important;
}

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

.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 {
  display: none !important;
}
