/**
 * Thème MIR — toutes les pages (charte institutionnelle)
 * Polices : DM Sans (texte), Fraunces (titres). À charger après bootstrap/style/colors.
 */

body.theme-mir {
  --mir-ink: #071422;
  --mir-ink-mid: #0f2844;
  --mir-ink-soft: #1a3a5c;
  --mir-gold: #c9a227;
  --mir-gold-light: #e8d48b;
  --mir-cream: #f6f3eb;
  --mir-surface: #ffffff;
  --mir-line: rgba(7, 20, 34, 0.08);
  --mir-shadow: 0 24px 60px rgba(7, 20, 34, 0.12);
  --mir-shadow-lg: 0 40px 80px rgba(7, 20, 34, 0.18);
  --mir-radius: 16px;
  --mir-radius-sm: 12px;
  --mir-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

body.theme-mir #pageWrapper,
body.theme-mir {
  font-family: "DM Sans", "Nunito Sans", "Segoe UI", system-ui, sans-serif;
  color: var(--mir-ink);
  -webkit-font-smoothing: antialiased;
}

body.theme-mir .h2Large,
body.theme-mir h1,
body.theme-mir h2,
body.theme-mir .lh44 {
  font-family: "Fraunces", "Cabin", Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

body.theme-mir #pageWrapper {
  overflow-x: hidden;
  overflow-y: visible;
}

/* ========== En-tête fixe ========== */
body.theme-mir .phStickyWrap {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1040;
  background: #fff;
  box-shadow: 0 4px 20px rgba(7, 20, 34, 0.08);
}

body.theme-mir #pageHeader {
  background: #fff;
}

/* Décale le contenu seulement si le header est dans .phStickyWrap (structure standard) */
body.theme-mir .phStickyWrap ~ main {
  padding-top: 5.25rem;
}

@media (min-width: 768px) {
  body.theme-mir .phStickyWrap ~ main {
    padding-top: 7.5rem;
  }
}

@media (min-width: 1200px) {
  body.theme-mir .phStickyWrap ~ main {
    padding-top: 8rem;
  }
}

body.theme-mir .hdTopBar {
  background: linear-gradient(90deg, #071422 0%, #0f2844 55%, #0a2540 100%) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

body.theme-mir .hdTopBar a {
  transition: color 0.2s ease, opacity 0.2s ease;
}

body.theme-mir .hdTopBar a:hover {
  color: var(--mir-gold-light) !important;
}

body.theme-mir .site-header {
  border-bottom: 1px solid var(--mir-line);
  background: rgba(255, 255, 255, 0.97) !important;
  backdrop-filter: saturate(160%) blur(12px);
  box-shadow: none;
}

body.theme-mir .site-header .navbar {
  padding-top: 0.85rem !important;
  padding-bottom: 0.85rem !important;
}

body.theme-mir .site-header .navbar-brand img {
  filter: drop-shadow(0 2px 8px rgba(7, 20, 34, 0.08));
  transition: transform 0.35s var(--mir-ease);
}

body.theme-mir .site-header .navbar-brand:hover img {
  transform: scale(1.02);
}

body.theme-mir .site-header .nav-link {
  position: relative;
  font-weight: 500;
  font-size: 0.92rem;
  letter-spacing: 0.03em;
  color: var(--mir-ink-mid) !important;
  padding: 0.5rem 0.85rem !important;
  border-radius: 8px;
  transition: color 0.3s var(--mir-ease), background 0.3s ease, transform 0.3s var(--mir-ease);
}

body.theme-mir .site-header .nav-item > .nav-link:not(.dropdown-toggle)::after {
  content: "";
  position: absolute;
  left: 0.65rem;
  right: 0.65rem;
  bottom: 0.35rem;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--mir-gold), var(--mir-gold-light));
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.35s var(--mir-ease);
  pointer-events: none;
}

body.theme-mir .site-header .nav-link:hover {
  color: var(--mir-ink) !important;
  background: rgba(201, 162, 39, 0.08);
  transform: translateY(-1px);
}

body.theme-mir .site-header .nav-item > .nav-link:not(.dropdown-toggle):hover::after {
  transform: scaleX(1);
}

body.theme-mir .site-header .dropdown-menu {
  border: 1px solid var(--mir-line);
  border-radius: var(--mir-radius-sm);
  box-shadow: var(--mir-shadow);
  padding: 0.5rem 0;
}

body.theme-mir .site-header .dropdown-item {
  font-size: 0.9rem;
  padding: 0.5rem 1.15rem;
}

body.theme-mir .site-header .dropdown-item:hover {
  background: rgba(201, 162, 39, 0.12);
  color: var(--mir-ink) !important;
}

body.theme-mir .site-header .navbar-nav,
body.theme-mir .site-header .navbar-collapse {
  overflow: visible;
}

body.theme-mir .site-header.scrolled {
  box-shadow: 0 12px 36px rgba(7, 20, 34, 0.1);
  border-bottom-color: rgba(7, 20, 34, 0.05);
}

/* ========== Boutons (hors hero accueil) ========== */
body.theme-mir .btn.btnTheme:before,
body.theme-mir .btn.btn-dark.btnSwitchDark:before {
  display: none !important;
  content: none !important;
}

body.theme-mir .btn.btnTheme .btnText,
body.theme-mir .btn.btn-dark.btnSwitchDark .btnText {
  opacity: 1 !important;
  transform: none !important;
  -webkit-transform: none !important;
  transform-style: flat !important;
  -webkit-transform-style: flat !important;
}

body.theme-mir .btn.btnTheme:hover .btnText,
body.theme-mir .btn.btn-dark.btnSwitchDark:hover .btnText {
  opacity: 1 !important;
  transform: none !important;
  -webkit-transform: none !important;
}

body.theme-mir .btn.btnTheme,
body.theme-mir .btn.btn-dark.btnSwitchDark {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 999px !important;
  transform: none !important;
  isolation: isolate;
  box-sizing: border-box;
}

body.theme-mir .btn.btnTheme:hover,
body.theme-mir .btn.btn-dark.btnSwitchDark:hover {
  transform: none !important;
}

body.theme-mir .btn.btnTheme .btnText {
  background-color: transparent !important;
  background: transparent !important;
  border-color: transparent !important;
}

body.theme-mir .btn.btnTheme .btnText,
body.theme-mir .btn.btn-dark.btnSwitchDark .btnText {
  transition: transform 0.4s var(--mir-ease), letter-spacing 0.4s ease, filter 0.3s ease;
}

body.theme-mir .site-header .btn.btnTheme {
  min-height: 2.65rem;
  min-width: 7.75rem;
  max-width: 100%;
  padding: 0 !important;
  margin-top: 0;
  background: linear-gradient(180deg, #143a5c 0%, var(--mir-ink) 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 2px 12px rgba(7, 20, 34, 0.12);
}

body.theme-mir .site-header .btn.btnTheme:hover {
  background: linear-gradient(180deg, #1a4a72 0%, #0c2036 100%) !important;
  box-shadow: 0 4px 18px rgba(7, 20, 34, 0.18);
  border-color: rgba(201, 162, 39, 0.35) !important;
}

body.theme-mir .site-header .btn.btnTheme .btnText {
  color: #fff !important;
  padding: 0.55rem 1.15rem !important;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  border: none !important;
}

body.theme-mir .site-header .btn.btnTheme:hover .btnText {
  transform: scale(1.05);
  filter: brightness(1.08);
}

/* ========== Bandeau de page (titres intérieurs) ========== */
body.theme-mir .pageMainHead {
  position: relative;
  min-height: 11rem;
  background-image: none !important;
  background: linear-gradient(135deg, #071422 0%, #0f2844 42%, #143a5c 100%) !important;
  border-bottom: 1px solid rgba(201, 162, 39, 0.35);
}

body.theme-mir .pageMainHead::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 120% at 100% 0%, rgba(201, 162, 39, 0.12), transparent 55%),
    radial-gradient(ellipse 60% 80% at 0% 100%, rgba(255, 255, 255, 0.06), transparent 50%);
  pointer-events: none;
}

body.theme-mir .pageMainHead .alignHolder,
body.theme-mir .pageMainHead .align {
  position: relative;
  z-index: 1;
}

body.theme-mir .pageMainHead h1 {
  font-family: "Fraunces", "Cabin", Georgia, serif;
  font-size: clamp(1.45rem, 2vw + 0.6rem, 2.15rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}

body.theme-mir .pageMainHead .breadcrumbWhite a,
body.theme-mir .pageMainHead .breadcrumbWhite .breadcrumb-item {
  color: rgba(255, 255, 255, 0.88) !important;
}

body.theme-mir .pageMainHead .breadcrumbWhite a:hover {
  color: var(--mir-gold-light) !important;
}

body.theme-mir .pageMainHead .breadcrumb-item.active {
  color: rgba(255, 255, 255, 0.65) !important;
}

body.theme-mir .pageMainHead .breadcrumb-item + .breadcrumb-item::before {
  color: rgba(255, 255, 255, 0.45);
}

/* Séparateur sous le bandeau */
body.theme-mir .border-image {
  height: 4px;
  background: linear-gradient(90deg, var(--mir-gold), var(--mir-gold-light), var(--mir-gold));
  opacity: 1;
}

/* ========== Contenu principal (pages intérieures) ========== */
body.theme-mir main .newsSingleWrap,
body.theme-mir main .contactSectionWrap {
  background: linear-gradient(180deg, #fafbfc 0%, #f4f6f9 100%);
}

body.theme-mir .newsSingleWrap .h1Medium,
body.theme-mir .newsSingleWrap .h2Medium,
body.theme-mir .contactSectionWrap .h2Medium {
  color: var(--mir-ink);
}

body.theme-mir .newsSingleWrap a:not(.btn):not(.page-numbers),
body.theme-mir .contactSectionWrap a:not(.btn) {
  color: var(--mir-ink-soft);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

body.theme-mir .newsSingleWrap a:not(.btn):not(.page-numbers):hover,
body.theme-mir .contactSectionWrap a:not(.btn):hover {
  color: var(--mir-gold);
  border-bottom-color: rgba(201, 162, 39, 0.45);
}

body.theme-mir .newsSingleWrap .img-fluid.rounded,
body.theme-mir .newsSingleWrap .nrcImageSlider img {
  border-radius: var(--mir-radius-sm) !important;
  box-shadow: var(--mir-shadow);
}

/* ========== Pied de page ========== */
body.theme-mir .ftAreaWrap {
  border-top: 1px solid rgba(201, 162, 39, 0.35);
  box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.15);
}

body.theme-mir .ftcaNav a {
  transition: color 0.25s ease;
}

body.theme-mir .ftcaNav a:hover {
  color: var(--mir-gold-light) !important;
}

/* ========== Accessibilité ========== */
@media (prefers-reduced-motion: reduce) {
  body.theme-mir .btn .btnText {
    transition: none !important;
    transform: none !important;
  }

  body.theme-mir .site-header .nav-link {
    transition: none !important;
    transform: none !important;
  }

  body.theme-mir .site-header .nav-item > .nav-link:not(.dropdown-toggle)::after {
    transition: none !important;
    transform: none !important;
  }
}

.mir-reduced-motion body.theme-mir .btn .btnText {
  transition: none !important;
  transform: none !important;
}

.mir-reduced-motion body.theme-mir .site-header .nav-link {
  transition: none !important;
  transform: none !important;
}

.mir-reduced-motion body.theme-mir .site-header .nav-item > .nav-link:not(.dropdown-toggle)::after {
  transition: none !important;
  transform: none !important;
}

/* ========== Révélation au scroll (pages intérieures, JS : mir-home-anim) ========== */
html.mir-home-anim body.theme-mir .mir-reveal:not(.is-visible) {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  will-change: opacity, transform;
}

html.mir-home-anim body.theme-mir .mir-reveal {
  transition: opacity 0.75s var(--mir-ease), transform 0.75s var(--mir-ease);
  transition-delay: calc(var(--mir-stagger, 0) * 0.05s);
}

html.mir-home-anim body.theme-mir .mir-reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

@media (prefers-reduced-motion: reduce) {
  html.mir-home-anim body.theme-mir .mir-reveal:not(.is-visible) {
    opacity: 1 !important;
    transform: none !important;
  }
}

.mir-reduced-motion body.theme-mir .mir-reveal:not(.is-visible) {
  opacity: 1 !important;
  transform: none !important;
}
