/**
 * Samsung Internet forced-dark compatibility.
 * No native dark theme. The browser reports light in both of its appearances,
 * so these rules intentionally work in either and never depend on dark mode.
 */
html:root {
  --devina-debug-css: loaded;
  --devina-debug-media: light-or-no-preference;
}
@media (prefers-color-scheme: dark) {
  html:root { --devina-debug-media: dark; }
}
html.samsung-browser {
  --devina-samsung-compat: active;
  --devina-samsung-light-plate: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Cpath fill='%23fff' d='M0 0h8v8H0z'/%3E%3C/svg%3E");
}

@media (forced-colors: none) {
  /* A single image-backed light header rather than individual white patches.
     Samsung's proprietary renderer may still dim the image. */
  .samsung-browser #header-parent,
  .samsung-browser .elementor-location-header,
  .samsung-browser #header-parent :is(.e-con, .e-con-inner, .elementor-section, .elementor-container):has(#the-menu-trigger),
  .samsung-browser .elementor-location-header :is(.e-con, .e-con-inner, .elementor-section, .elementor-container):has(#the-menu-trigger) {
    background-color: #fff !important;
    background-image: var(--devina-samsung-light-plate) !important;
    background-size: 100% 100% !important;
    background-repeat: no-repeat !important;
    color: #414347;
  }

  /* Keep a local backing as a fallback if a database-defined header
     container covers the continuous background. */
  .samsung-browser #header-parent :is(.devina-site-logo img, img.devina-site-logo, .elementor-widget-theme-site-logo img, img.custom-logo, img[src*="logo" i], img[alt*="devina" i]),
  .samsung-browser .elementor-location-header :is(.devina-site-logo img, img.devina-site-logo, .elementor-widget-theme-site-logo img, img.custom-logo) {
    background-image: var(--devina-samsung-light-plate) !important;
    background-size: 100% 100% !important;
    background-repeat: no-repeat !important;
  }

  /* Experimental contrast: blend the white logo silhouette with the
     rendered background instead of relying on SVG foreground recolouring.
     Samsung's forced-dark state is not exposed to the page. */
  .samsung-browser .devina-brand-logo--original {
    display: none !important;
  }
  .samsung-browser .devina-brand-logo--adaptive {
    display: block !important;
    color: #fff;
    mix-blend-mode: difference;
    background: transparent !important;
  }

  /* Both hero arrow strokes now use currentColor, like the PDF icon.
     Keep the outline border tied to the label instead of independent white. */
  .samsung-browser .devina-home-hero__actions .devina-home-button--outline-light {
    border-color: currentColor;
  }
  .samsung-browser .devina-home-hero__actions .devina-home-icon {
    filter: none !important;
  }

  /* Draw the circle and strokes together as an image, to prevent the
     browser from independently recolouring the CSS lines and backing.
     The existing accessible button, JS and open/close state stay intact. */
  .samsung-browser body button#the-menu-trigger.devina-menu-trigger,
  .samsung-browser body button#the-menu-trigger.devina-menu-trigger:is(:hover, :focus, :active) {
    border-color: transparent !important;
    background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 52 52'%3E%3Ccircle cx='26' cy='26' r='25.5' fill='%23fff' stroke='%23111'/%3E%3Cpath d='M11 18h30M11 26h30M11 34h30' fill='none' stroke='%23111' stroke-width='1'/%3E%3C/svg%3E") center / 100% 100% no-repeat !important;
    color: #111 !important;
  }
  .samsung-browser body button#the-menu-trigger.devina-menu-trigger.is-open {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 52 52'%3E%3Ccircle cx='26' cy='26' r='25.5' fill='%23fff' stroke='%23111'/%3E%3Cpath d='M15 15l22 22M37 15L15 37' fill='none' stroke='%23111' stroke-width='1'/%3E%3C/svg%3E") !important;
  }
  .samsung-browser body button#the-menu-trigger.devina-menu-trigger .devina-menu-trigger__line {
    opacity: 0;
  }
  .samsung-browser body button#the-menu-trigger.devina-menu-trigger:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 4px;
  }
}
