/* =====================================================
   Document Maker Template Isolation CSS
   Ensures template styles don't affect main website
   ===================================================== */

/* CRITICAL: Force website header to maintain original fonts */
/* This must come first to override any template styles */
.site-header, header, .main-header, .website-header, #masthead,
.site-header *, header *, .main-header *, .website-header *, #masthead *,
.site-navigation, .nav-menu, .site-navigation *, .nav-menu * {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  font-weight: 600 !important;
  letter-spacing: 0.2px !important;
}

/* Protect icon fonts specifically */
.site-header i, header i, .main-header i, #masthead i,
.site-header .icon, header .icon, .main-header .icon, #masthead .icon,
.site-header .fa, header .fa, .main-header .fa, #masthead .fa,
.site-header .fas, header .fas, .main-header .fas, #masthead .fas,
.site-header .far, header .far, .main-header .far, #masthead .far,
.site-header .fab, header .fab, .main-header .fab, #masthead .fab,
.site-header .svg-icon, header .svg-icon, .main-header .svg-icon, #masthead .svg-icon {
  font-family: "Font Awesome 5 Free", "Font Awesome 6 Free", "FontAwesome", "Inter", sans-serif !important;
  speak: none !important;
  font-style: normal !important;
  font-weight: normal !important;
  font-variant: normal !important;
  text-transform: none !important;
  line-height: 1 !important;
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
}

/* Scope all template content to prevent style leakage */
.dm-template-container {
  /* Reset any inherited styles that might affect the main site */
  all: initial;
  font-family: inherit;
  line-height: inherit;
  color: inherit;
  background: transparent;
  margin: 0;
  padding: 0;
  border: none;
  box-shadow: none;
  text-decoration: none;
  list-style: none;
  contain: layout style paint;
  isolation: isolate;
}

/* Wedding Biodata Template - Scoped Styles */
.dm-wedding-biodata-template {
  /* Isolate this template completely */
  position: relative;
  z-index: 1;
  font-family: Georgia, serif !important;
  width: 210mm !important;
  min-height: 594mm !important;
  margin: 0 !important;
  padding: 0 !important;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
  color: #2c3e50 !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
  /* CRITICAL: Prevent font inheritance from affecting parent elements */
  isolation: isolate !important;
  contain: layout style paint !important;
}

/* Override any inline styles that might leak from wedding biodata template */
.dm-wedding-biodata-template[style*="font-family"] {
  /* This ensures the template's font-family is contained */
  isolation: isolate !important;
  contain: layout style paint !important;
}

/* Ensure template styles don't leak to parent elements */
.dm-wedding-biodata-template * {
  box-sizing: border-box !important;
}

/* All other templates should also be scoped */
.dm-template-content {
  position: relative;
  z-index: 1;
  isolation: isolate;
}

/* Prevent any template from affecting navigation or header */
.dm-template-container .site-header,
.dm-template-container header,
.dm-template-container .main-header,
.dm-template-container .website-header,
.dm-template-container #masthead,
.dm-template-container .site-navigation,
.dm-template-container .nav-menu {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  font-weight: 600 !important;
  letter-spacing: 0.2px !important;
  color: inherit !important;
  background: inherit !important;
}
