/*
 * X-Grid child theme — theme-level concerns only.
 *
 * All component styling for plugin-rendered markup (configurator, stockists,
 * contact form, shortcode cards) lives in the plugin's own stylesheet so it
 * travels with the markup it styles. Everything else is native Elementor:
 * the active Kit carries colour and typography tokens, and the header and
 * footer are Elementor theme templates.
 */

/* --- Accessibility ------------------------------------------------------ */

:focus-visible { outline: 2px solid #111; outline-offset: 2px; }

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}

/* Otherwise the UA's default link blue shows through in the a11y tree. */
.skip-link { color: var(--e-global-color-primary); }

.skip-link:focus {
  position: fixed; top: 12px; left: 12px; z-index: 9999;
  width: auto; height: auto; clip: auto; clip-path: none;
  padding: 12px 18px; color: #fff; background: #111; font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* --- Monochrome photography ---------------------------------------------
 * The brand rule is no colour hues anywhere, photography included. Applying
 * it in CSS rather than baking grey pixels into the files means new uploads
 * inherit the treatment automatically and nothing becomes irreversible.
 * Design-language revision: the greyscale rule governs the INTERFACE
 * (surfaces, rules, labels, buttons). Photography keeps its natural colour —
 * product greens, gravel tones and grass read as evidence, not decoration.
 * The hero keeps its own dark gradient overlay for headline contrast.
 */

/* --- Design-language corrections ----------------------------------------
 * A few widget defaults are hardcoded in plugin CSS and have no control in
 * the editor. They are listed here rather than hunted per-template so the
 * monochrome rule stays enforceable in one place.
 */

/* Pro paints the current dropdown item with a slate chip (#3f444b). Scoped
 * through the theme's own body class so the override outranks plugin CSS
 * that is enqueued after this stylesheet. */
.xgrid-site .elementor-nav-menu--dropdown .elementor-item.elementor-item-active,
.xgrid-site .elementor-nav-menu--dropdown .elementor-item.highlighted,
.xgrid-site .elementor-nav-menu--dropdown .elementor-sub-item.elementor-item-active {
  background-color: transparent;
}

/* --- Header navigation -----------------------------------------------------
 * Desktop dropdowns are pure CSS: hover and keyboard focus open the panel,
 * with no dependency on Pro's frontend JS (its bundle never bootstraps on
 * this build, so SmartMenus is never initialized and its display toggling
 * never runs). Panels are anchored to their parent item — hairline edge,
 * square corners, soft shadow. The mobile dropdown below 1025px keeps its
 * paper-sheet look from the widget settings and is untouched by this block,
 * but the elementor-invisible FOUC guard is lifted on all viewports (see
 * the duplicated rule below) because Pro's JS never clears it anywhere.
 */
.xgrid-site .elementor-widget-nav-menu.elementor-invisible {
  visibility: visible;
}
@media (min-width: 1025px) {

  /* Panel chrome: comfortable single-column sheet under the parent item. */
  .xgrid-site .elementor-nav-menu--main .elementor-nav-menu > li > ul.elementor-nav-menu--dropdown,
  .xgrid-site .elementor-nav-menu--main .elementor-nav-menu > li > ul.sub-menu {
    min-width: 260px;
    padding: 6px 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  }
  .xgrid-site .elementor-nav-menu--main .sub-menu a.elementor-item,
  .xgrid-site .elementor-nav-menu--main .elementor-nav-menu--dropdown a.elementor-sub-item {
    padding: 10px 24px;
    white-space: nowrap;
  }

  /* THE OPEN MECHANISM — pure CSS, no JS. SmartMenus base CSS hides submenus
   * with display:none; hover or keyboard focus on the item shows them.
   * Scoped to the desktop menu (--main) so the mobile dropdown, which relies
   * on the burger toggle, is unaffected. */
  .xgrid-site .elementor-nav-menu--main .elementor-nav-menu > li:hover > ul,
  .xgrid-site .elementor-nav-menu--main .elementor-nav-menu > li:focus-within > ul,
  .xgrid-site .elementor-nav-menu--main .elementor-nav-menu > li > a:focus + ul {
    display: block !important;
    visibility: visible;
    opacity: 1;
  }
  /* Sub-items must not stay display:none when their panel opens. */
  .xgrid-site .elementor-nav-menu--main .elementor-nav-menu > li:hover > ul > li,
  .xgrid-site .elementor-nav-menu--main .elementor-nav-menu > li:focus-within > ul > li {
    display: block;
  }

  /* Conventional desktop affordance: caret after parent items with children,
   * rotating when the panel is open. */
  .xgrid-site .elementor-nav-menu--main .elementor-nav-menu > li.menu-item-has-children > a > .sub-arrow {
    margin-left: 6px;
    transition: transform 0.15s ease;
  }
  .xgrid-site .elementor-nav-menu--main .elementor-nav-menu > li.menu-item-has-children:hover > a > .sub-arrow,
  .xgrid-site .elementor-nav-menu--main .elementor-nav-menu > li.menu-item-has-children:focus-within > a > .sub-arrow {
    transform: rotate(180deg);
  }

  /* Keyboard focus support: a visible focus ring that matches the datasheet
   * language (the theme's global :focus-visible outline is white-on-paper
   * here and would vanish against the header). */
  .xgrid-site .elementor-nav-menu--main .elementor-nav-menu > li > a:focus-visible {
    outline: 2px solid #111;
    outline-offset: -2px;
  }
  .xgrid-site .elementor-nav-menu--main .elementor-nav-menu--dropdown a:focus-visible {
    outline: 2px solid #111;
    outline-offset: -2px;
  }
}

/* Keep parent rows clickable (default Pro behaviour makes parents toggle-only). */
.xgrid-site .elementor-nav-menu--main .elementor-nav-menu > li.menu-item-has-children > a.elementor-item {
  pointer-events: auto;
}

/* Tighter horizontal item padding so [logo | menu | CTA] holds one row. */
.xgrid-site .elementor-nav-menu--main .elementor-nav-menu > li > a.elementor-item {
  padding-left: 12px;
  padding-right: 12px;
}

/* Header CTA: compact so the row [logo | menu | CTA] holds on one line. */
.xgrid-site .xg-header-bar .elementor-button.elementor-size-sm {
  padding: 10px 18px;
  font-size: 13px;
  white-space: nowrap;
}

/* Main bar spacing: tighter vertical padding keeps the header to a
 * conventional ~72px total height with the 45px logo. */
.xgrid-site .xg-header-bar {
  padding-top: 12px;
  padding-bottom: 12px;
}

/* Dropdown panels inherit the paper background and square corners; make
 * sure submenu text is not uppercase like the top level. */
.xgrid-site .elementor-nav-menu--main .elementor-nav-menu--dropdown .elementor-item {
  text-transform: none;
  letter-spacing: 0.2px;
}

/* The utility strip is an announcement, not navigation: it wastes vertical
 * space and wraps untidily on small screens, so it is desktop-only. */
@media (max-width: 1024px) {
  .xgrid-site .xg-utility { display: none; }
}

/* --- Sticky header (desktop) ------------------------------------------------ */
@media (min-width: 1025px) {
  .xgrid-site .xg-header-bar {
    position: sticky;
    top: 0;
    z-index: 90;
    background: #f4f4f2; /* paper — re-stated so the sticky bar is opaque over content */
    box-shadow: 0 1px 0 #d4d4d2;
  }
}

/* Elementor ships 3px radius on buttons; the datasheet look is square. The
 * Kit sets this too, but this catches buttons rendered outside the Kit scope
 * (for example inside the editor's own preview surfaces). */
.xgrid-site .elementor-button,
.xgrid-site .elementor-menu-toggle,
.xgrid-site .elementor-nav-menu--dropdown,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="search"],  textarea,
  select { border-radius: 0; }

/* A single long word must never be able to drag the page sideways. */
.xgrid-site h1,
.xgrid-site h2,
.xgrid-site h3,
.xgrid-site .elementor-heading-title { overflow-wrap: break-word; }

/* --- Editor-facing helpers ---------------------------------------------- */

.elementor-widget-image img,
.elementor-widget-theme-post-featured-image img { height: auto; }

/* --- Gallery neatening -----------------------------------------------------
 * Elementor's core gallery renders mixed aspect ratios raggedly. Datasheet
 * discipline: every tile is a uniform 3:2 crop on a paper ground with a
 * hairline edge; captions sit on the paper, not over the photo.
 */
.xgrid-site .xg-gallery .gallery-item img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  display: block;
}
.xgrid-site .xg-gallery .gallery-item {
  margin: 0;
}
.xgrid-site .xg-gallery .gallery-caption {
  font-family: var(--e-global-typography-text-font-family, "Barlow"), sans-serif;
  font-size: 12px;
  color: var(--e-global-color-custom, #6E6E6E);
  padding: 8px 2px 0;
}
.xgrid-site .xg-gallery {
  display: grid;
  gap: 18px;
}

/* --- Project case studies (single-xg_project.php) --------------------------
 * These templates render outside the Elementor canvas, so they carry their
 * own layout here — the plugin's tools stylesheet only loads on shortcode
 * pages and must never be a dependency for a readable case study.
 */
.xg-project-single { --xg-hairline: #d4d4d2; --xg-ink: #111111; --xg-slate: #6e6e6e; --xg-text: #2b2b2b; --xg-mono: "IBM Plex Mono", "Consolas", monospace; }
.xg-project-hero { padding: 72px 24px 28px; border-bottom: 1px solid var(--xg-hairline); }
.xg-project-hero > .xg-shell,
.xg-project-single .xg-shell { width: 100%; max-width: 1200px; margin-left: auto; margin-right: auto; }
.xg-project-hero .xg-shell { padding: 0; }
.xg-project-hero h1 { margin: 6px 0 0; font-family: "Barlow Condensed", sans-serif; font-weight: 600; font-size: clamp(40px, 5.5vw, 64px); line-height: 0.95; letter-spacing: -0.5px; color: var(--xg-ink); }
.xg-project-hero .xg-eyebrow { margin: 0; font-family: var(--xg-mono); font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--xg-slate); }
.xg-prose { max-width: 800px; padding: 40px 24px 8px; margin: 0 auto; color: var(--xg-text); font-size: 17px; }
.xg-prose > * { max-width: none; }
.xg-prose p { margin: 0 0 18px; line-height: 1.65; }
.xg-prose h2 { font-family: "Barlow Condensed", sans-serif; font-weight: 600; font-size: 30px; line-height: 1.1; color: var(--xg-ink); margin: 34px 0 12px; }
.xg-prose ul, .xg-prose ol { margin: 0 0 18px; padding-left: 22px; }
.xg-prose li { margin-bottom: 6px; line-height: 1.55; }
.xg-project-gallery { max-width: 1200px; margin: 0 auto; padding: 24px 24px 8px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.xg-project-gallery__img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; display: block; border: 1px solid var(--xg-hairline); }
.xg-project-footer { max-width: 1200px; margin: 0 auto; padding: 8px 24px 64px; }
.xg-project-footer .xg-text-link { color: var(--xg-ink); font-weight: 700; }
@media (max-width: 640px) {
  .xg-project-gallery { grid-template-columns: 1fr; }
}

/* --- One-off widths on a shared background ---------------------------------
 * The downloads repo is a wide index, not an editorial page: let its cards
 * breathe beyond the boxed shell without touching any other section.
 */
.xgrid-site .xg-downloads-shell { max-width: 1440px; }
.xgrid-site .xg-downloads-shell .xg-grid--3 { gap: 20px; }
.xgrid-site .xg-downloads-shell .xg-card { padding: 24px; }
.xgrid-site .xg-downloads-shell .xg-card h2 { font-size: 20px; }

/* --- Editorial details -------------------------------------------------------
 * Figure captions read as plate annotations; FAQ toggles read as datasheet
 * rows: square corners, hairline rules, quiet reveal.
 */
.xgrid-site .xg-figure { margin: 0; }
.xgrid-site .xg-figure figcaption {
  font-family: "IBM Plex Mono", "Consolas", monospace;
  font-size: 12px;
  letter-spacing: 0.3px;
  color: #6e6e6e;
  padding-top: 8px;
  line-height: 1.5;
}
.xgrid-site .elementor-toggle { text-align: left; }
.xgrid-site .elementor-toggle .elementor-toggle-item { border: 1px solid #d4d4d2; }
.xgrid-site .elementor-toggle .elementor-toggle-item + .elementor-toggle-item { border-top: 0; }
.xgrid-site .elementor-toggle .elementor-tab-title {
  border-radius: 0;
  font-weight: 600;
  padding: 18px 24px;
  color: #111111;
}
.xgrid-site .elementor-toggle .elementor-tab-title.elementor-active { border-bottom-color: transparent; }
.xgrid-site .elementor-toggle .elementor-tab-content {
  border-radius: 0;
  padding: 4px 24px 22px;
  color: #2b2b2b;
  font-size: 16px;
  line-height: 1.65;
}

/* --- Verification badges -----------------------------------------------------
 * Used on the comparison page to indicate claim verification status.
 *   verified   - backed by downloaded documentation (green-check aesthetic, kept monochrome)
 *   unverified - claim made but no supporting documentation found
 *   partial    - documentation exists but shows discrepancy with current claims
 */
.xg-verification {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: "IBM Plex Mono", "Consolas", monospace;
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 2px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.xg-verification--verified {
  background: #e9e9e7;
  color: #111111;
  border-color: #d4d4d2;
}

.xg-verification--unverified {
  background: #fff8f0;
  color: #8b6633;
  border-color: #e8c48a;
}

.xg-verification--partial {
  background: #fff5f5;
  color: #8b3333;
  border-color: #e8a0a0;
}

.xg-verification__icon {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.xg-verification__label {
  font-weight: 600;
}

.xg-verification__status {
  opacity: 0.7;
}

.xg-verification__tooltip {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #111111;
  color: #e9e9e7;
  padding: 8px 12px;
  font-size: 11px;
  font-family: "IBM Plex Mono", monospace;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  z-index: 100;
  margin-bottom: 8px;
  border-radius: 2px;
}

.xg-verification:hover .xg-verification__tooltip,
.xg-verification:focus-within .xg-verification__tooltip {
  display: block;
  opacity: 1;
}

/* --- Comparison table -------------------------------------------------------
 * Designed as a datasheet table: hairline rules, monospace labels, aligned
 * columns. X-Grid column is highlighted to distinguish our product.
 */
.xg-comparison-table {
  margin: 0 0 32px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.xg-table--comparison {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 720px;
}

.xg-table--comparison th,
.xg-table--comparison td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #d4d4d2;
  vertical-align: top;
}

.xg-table--comparison thead th {
  font-family: "IBM Plex Mono", "Consolas", monospace;
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #6e6e6e;
  background: #fafafa;
  border-bottom: 2px solid #d4d4d2;
}

.xg-table--comparison tbody th {
  font-family: "IBM Plex Mono", "Consolas", monospace;
  font-size: 11px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: #6e6e6e;
  white-space: nowrap;
  width: 180px;
}

.xg-table--comparison .xg-cell--xgrid {
  background: #f5f5f5;
  font-weight: 600;
  color: #111111;
}

.xg-table--comparison .xg-cell--competitor {
  color: #2b2b2b;
}

.xg-table--comparison .xg-cell-note {
  display: block;
  font-size: 11px;
  color: #6e6e6e;
  font-weight: 400;
  margin-top: 4px;
}

.xg-table--comparison tr:last-child td,
.xg-table--comparison tr:last-child th {
  border-bottom: 0;
}

.xg-comparison-note {
  padding: 16px;
  background: #fafafa;
  border: 1px solid #d4d4d2;
  font-size: 13px;
  line-height: 1.55;
  color: #2b2b2b;
  margin-top: 8px;
}

.xg-comparison-note .xg-eyebrow {
  font-family: "IBM Plex Mono", "Consolas", monospace;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #6e6e6e;
  display: block;
  margin-bottom: 6px;
}

.xg-warning-mark {
  color: #8b6633;
  font-weight: 600;
}

/* --- Competitor detail cards --------------------------------------------------
 * Used on the comparison page to show individual competitor details.
 */
.xg-competitor-card {
  border: 1px solid #d4d4d2;
  padding: 24px;
  margin-bottom: 24px;
  background: #fff;
}

.xg-competitor-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #d4d4d2;
}

.xg-competitor-card__name {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 600;
  font-size: 24px;
  color: #111111;
  margin: 0;
}

.xg-competitor-card__body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
  margin-bottom: 16px;
}

.xg-definition-list {
  margin: 0;
}

.xg-definition-list dt {
  font-family: "IBM Plex Mono", "Consolas", monospace;
  font-size: 11px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: #6e6e6e;
  margin-bottom: 4px;
}

.xg-definition-list dd {
  margin: 0 0 12px;
  color: #2b2b2b;
  font-size: 14px;
  line-height: 1.4;
}

.xg-verification-note,
.xg-competitor-notes {
  padding: 12px;
  background: #fafafa;
  border-left: 3px solid #d4d4d2;
  margin-top: 16px;
  font-size: 13px;
  line-height: 1.5;
  color: #2b2b2b;
}

.xg-verification-note .xg-eyebrow,
.xg-competitor-notes .xg-eyebrow {
  font-family: "IBM Plex Mono", "Consolas", monospace;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #6e6e6e;
  display: block;
  margin-bottom: 4px;
}

.xg-competitor-card__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: "Barlow", sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: #111111;
  text-decoration: none;
  padding: 10px 0;
  border-top: 1px solid #d4d4d2;
  margin-top: 16px;
}

.xg-competitor-card__link:hover {
  color: #4a4a4a;
}

.xg-link-icon {
  width: 14px;
  height: 14px;
  transition: transform 0.15s;
}

.xg-competitor-card__link:hover .xg-link-icon {
  transform: translateX(3px);
}

@media (max-width: 640px) {
  .xg-competitor-card__body {
    grid-template-columns: 1fr;
  }
}

/* --- Section headers for comparison page ------------------------------------
 * Eyebrow + heading combinations specific to the comparison content.
 */
.xg-compare-section {
  padding: 92px 24px;
}

.xg-compare-section .xg-shell {
  max-width: 1200px;
  margin: 0 auto;
}

.xg-compare-eyebrow {
  font-family: "IBM Plex Mono", "Consolas", monospace;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #6e6e6e;
  margin-bottom: 12px;
}

.xg-compare-heading {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 600;
  font-size: clamp(36px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.5px;
  color: #111111;
  margin: 0;
}

.xg-compare-lede {
  font-size: 18px;
  line-height: 1.6;
  color: #2b2b2b;
  max-width: 720px;
  margin: 20px 0 32px;
}

/* --- Transparency callout box -----------------------------------------------
 * Highlight box for the key transparency message.
 */
.xg-transparency-box {
  padding: 24px;
  background: #f5f5f5;
  border: 1px solid #d4d4d2;
  margin: 32px 0;
}

.xg-transparency-box h3 {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 600;
  font-size: 24px;
  color: #111111;
  margin: 0 0 12px;
}

.xg-transparency-box p {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: #2b2b2b;
}

.xg-transparency-box .xg-actions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* --- Research date footer for comparison page --------------------------------
 * Shows when the competitor research was conducted.
 */
.xg-research-footer {
  padding: 32px 24px;
  border-top: 1px solid #d4d4d2;
  font-size: 12px;
  color: #6e6e6e;
  text-align: center;
}

.xg-research-footer .xg-eyebrow {
  font-family: "IBM Plex Mono", "Consolas", monospace;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px;
}
