/*
Theme Name: Solo Virtue Child
Description: Solo Motorsports presentation for Virtue Premium.
Template: virtue_premium
Version: 1.0.16
Text Domain: solo-virtue-child
*/

:root {
    /* Keep a two-pixel visible stroke when the browser rounds to device pixels. */
    --solo-control-stroke: 2.25px;
}

body.wide {
    --solo-header-content-width: min(calc(100% - 32px), 1140px);
}

/* Match the vehicle picker column across Virtue's desktop and mobile headers. */
body.wide :is(#kad-banner, #kad-mobile-banner) > .container {
    width: var(--solo-header-content-width);
    padding-inline: 0;
}

/* The seasonal banner shares the same column at every width. */
body.wide > #solo-sitewide-sale-banner .solo-sitewide-site-width {
    width: var(--solo-header-content-width);
    max-width: none;
}

@media (min-width: 621px) {
    body.wide > #solo-sitewide-sale-banner .solo-sitewide-site-width {
        grid-template-columns: minmax(0, 1fr) minmax(280px, 44%);
    }

    body.wide > #solo-sitewide-sale-banner .solo-sitewide-sale-message {
        padding-inline: clamp(0px, calc((100vw - 620px) / 10), 32px);
    }

    body.wide > #solo-sitewide-sale-banner .solo-sitewide-sale-coupon {
        white-space: normal;
    }
}

@media (max-width: 620px) {
    body.wide > #solo-sitewide-sale-banner .solo-sitewide-site-width {
        min-height: 171px;
    }
}

/* Match the page width when Virtue's sticky banner still has its pre-resize width. */
body.wide #kad-mobile-banner[data-mobile-header-sticky="1"] {
    width: 100% !important;
}

/* Give the native mobile header search room without changing its menu behavior. */
#mh-kad-menu-search-popup > .mh-kt-search-container {
    padding-block: 10px;
}

#mh-kad-menu-search-popup .form-search :is(.search-query, .search-icon) {
    height: 52px;
    font-size: 16px;
}

#mh-kad-menu-search-popup .form-search .search-query {
    padding-inline-start: 52px;
}

#mh-kad-menu-search-popup .form-search .search-icon {
    width: 44px;
    padding: 0;
}

/* Solo storefront · Baja 1000, RM 130.
   Course geometry: https://score-raceinfo.com/gps-files-2026-baja-1000/
   Relief produced using Copernicus WorldDEM-30 © DLR e.V. 2010-2014 and © Airbus Defence
   and Space GmbH 2014-2018 provided under COPERNICUS by the European Union and ESA; all rights reserved.
   The organisations in charge of the Copernicus programme by law or by delegation do not incur
   any liability for any use of the Copernicus WorldDEM-30. */
body.wide {
  --solo-map-image: url("assets/solo-baja-1000-rm940-desktop.webp?ver=1.0.15");
  --solo-map-position: center;
  --solo-map-wash: #f6f7f536;
  --solo-map-surface: #f2f3f4;
  --solo-map-art: linear-gradient(var(--solo-map-wash), var(--solo-map-wash)),
    var(--solo-map-image) var(--solo-map-position) / cover no-repeat #edf0ec;
}
body.home {
  isolation: isolate;
  background: var(--solo-map-surface);
}
/* The live mobile menu is still visible at 992px. Keep touch tablets full width. */
@media screen and (width > 992px) and (pointer: fine) {
  body.wide {
    /* Preserve current gutters at smaller desktop widths. Cap the shell on wider screens. */
    --solo-map-gutter: max(
      clamp(12px, calc((100% - 1200px) / 2), 64px),
      calc((100% - 1264px) / 2)
    );
    --solo-map-side-layer: "";
    --solo-map-side-background: var(--solo-map-art);
    isolation: isolate;
    background: var(--solo-map-surface);
  }
  body.wide > #wrapper.container {
    /* Virtue sets the wide wrapper width with !important. */
    width: calc(100% - var(--solo-map-gutter) - var(--solo-map-gutter)) !important;
    margin-inline: auto;
    background-color: var(--solo-map-surface);
  }
  /* A native fixed-width container can overrun the frame at the desktop breakpoint. */
  body.wide > #wrapper.container :where(.container) {
    max-width: 100%;
  }
  body.wide > #solo-sitewide-sale-banner {
    margin-inline: var(--solo-map-gutter);
  }
  /* Keep the current spacer surface if the menu is fixed. */
  body.home #kad-banner-sticky-wrapper.is-sticky {
    background-color: var(--solo-map-surface);
  }
  /* Virtue's fixed desktop header otherwise spans the viewport. */
  body.wide #kad-banner-sticky-wrapper.is-sticky #kad-banner {
    inset-inline: var(--solo-map-gutter);
    width: auto !important;
  }
}
body.wide > #wrapper.container > .contentclass,
body.home .contentclass {
  background: var(--solo-map-surface);
}
body.home .contentclass {
  /* The mobile sticky header writes a second 15px top inset inline. */
  padding-top: 0 !important;
}
/* Keep the wide checkout block inside the same column as its page heading. */
body.woocommerce-checkout #content .wp-block-woocommerce-checkout.alignwide {
  inset-inline: auto;
  width: 100%;
  max-width: 100%;
  margin-inline: 0;
}
body.home #solo-home-intro-title {
  position: relative;
  isolation: isolate;
  clip-path: inset(0 round 5px);
  display: flex;
  align-items: center;
  box-sizing: border-box;
  width: min(100%, 1040px);
  min-height: 96px;
  margin: 16px auto;
  padding: 20px clamp(20px, 2.3vw, 36px);
  background: #edf0ec;
  color: #252525;
  font-size: clamp(26px, 2.15vw, 34px);
  line-height: 1.13;
  text-wrap: pretty;
}
/* Both openings look at the same viewport coordinates and reuse the same image URL. */
@media screen and (prefers-reduced-motion: no-preference) {
  body.wide::before, body.home #solo-home-intro-title::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background: var(--solo-map-art);
  }
  body.wide::before {
    content: var(--solo-map-side-layer, none);
    background: var(--solo-map-side-background, none);
  }
}
body.home #solo-home-intro-title::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  border: 1px solid #b9c2bd;
  border-radius: 5px;
  background: var(--solo-map-title-fill, rgba(242, 243, 244, 0.5));
}
@media (max-width: 992px), (pointer: coarse), (pointer: none) {
  body.home {
    --solo-map-image: url("assets/solo-baja-1000-rm940-phone.webp?ver=1.0.15");
    --solo-map-position: 73% 23%;
    --solo-map-wash: #f6f7f532;
  }
  body.home #solo-home-intro-title {
    min-height: 144px;
    margin-block: 16px;
    padding: 16px 10% 16px 14px;
    font-size: clamp(24px, 6.6vw, 30px);
  }
}
@media (forced-colors: active), print {
  body.wide::before, body.home #solo-home-intro-title::before, body.home #solo-home-intro-title::after {
    content: none;
    background: none;
  }
}
@media (max-width: 767px) {
  body.home #solo-home-intro-title {
    width: calc(100% + 8px);
    margin-inline: -4px;
  }
}
