/*
 * X-Grid component styles for plugin-rendered markup:
 * the configurator, stockist finder, contact form and shortcode cards.
 *
 * Design language: monochrome technical datasheet. Ink on paper, hairline
 * rules, square corners, mono small-caps labels. No colour hues and no
 * rounded "product marketing" chrome. Elementor's Kit carries the same
 * tokens for everything built natively.
 */

:root {
  --xg-ink: #111111;
  --xg-steel: #4a4a4a;
  --xg-text: #2b2b2b;
  --xg-slate: #6e6e6e;
  --xg-mist: #e9e9e7;
  --xg-hairline: #d4d4d2;
  --xg-paper: #ffffff;
  --xg-focus: #111111;
  --xg-mono: "IBM Plex Mono", "Consolas", monospace;
}

[hidden] { display: none !important; }

/* Links inside tool markup (consent lines, help text) follow the ink palette
   rather than the user agent's default blue. */
.xg-tool a,
.xg-contact-form a,
.xg-notice a,
.xg-card a,
.xg-stockist-results a {
  color: var(--xg-ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.xg-tool a:hover,
.xg-tool a:focus-visible,
.xg-contact-form a:hover,
.xg-contact-form a:focus-visible,
.xg-notice a:hover,
.xg-notice a:focus-visible,
.xg-card a:hover,
.xg-card a:focus-visible,
.xg-stockist-results a:hover,
.xg-stockist-results a:focus-visible { text-decoration-thickness: 2px; }

.xg-tool {
  max-width: 880px;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 50px);
  background: var(--xg-paper);
  border: 1px solid var(--xg-hairline);
}

/* --- Configurator ------------------------------------------------------- */

.xg-config__progress { height: 3px; margin-bottom: 34px; overflow: hidden; background: var(--xg-mist); }
.xg-config__progress span { display: block; width: 25%; height: 100%; background: var(--xg-ink); transition: width .25s ease; }

.xg-config__step { display: none; margin: 0 0 26px; padding: 0; border: 0; }
.xg-config__step.is-active { display: block; }
.xg-config__step legend {
  display: flex; align-items: baseline; gap: 14px; width: 100%; margin-bottom: 22px; padding: 0;
  font-family: var(--xg-mono); font-size: 12px; font-weight: 400;
  letter-spacing: .08em; text-transform: uppercase;
}
.xg-config__step legend span {
  display: inline-grid; place-items: center; min-width: 30px; height: 30px;
  color: var(--xg-paper); background: var(--xg-ink); font-size: 13px; letter-spacing: 0;
}

.xg-config label, .xg-contact-form label, .xg-stockist-tool label {
  display: block; margin: 0 0 16px; color: var(--xg-text); font-size: 14px; font-weight: 600;
}
.xg-config label > span, .xg-contact-form label > span { color: var(--xg-slate); font-size: .9em; font-weight: 400; }

.xg-config input:not([type="radio"]):not([type="checkbox"]), .xg-config select, .xg-config textarea,
.xg-contact-form input:not([type="checkbox"]), .xg-contact-form textarea, .xg-stockist-tool input {
  display: block; width: 100%; min-height: 52px; margin-top: 6px; padding: 12px 14px;
  color: var(--xg-ink); background: var(--xg-paper);
  border: 1px solid var(--xg-hairline); border-radius: 0;
  font: inherit; font-weight: 400;
}
.xg-config input:focus-visible, .xg-config select:focus-visible, .xg-config textarea:focus-visible,
.xg-contact-form input:focus-visible, .xg-contact-form textarea:focus-visible, .xg-stockist-tool input:focus-visible {
  outline: 2px solid var(--xg-focus); outline-offset: 2px; border-color: var(--xg-ink);
}
.xg-config textarea, .xg-contact-form textarea { min-height: 130px; resize: vertical; }

.xg-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }

.xg-choice-group { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 6px 0 18px; }
.xg-choice-group label { position: relative; margin: 0; }
.xg-choice-group input { position: absolute; opacity: 0; pointer-events: none; }
.xg-choice-group span {
  display: block; height: 100%; min-height: 120px; padding: 16px 18px;
  color: var(--xg-ink); background: var(--xg-paper);
  border: 1px solid var(--xg-hairline); border-radius: 0;
  font-size: 18px; font-weight: 700; cursor: pointer; transition: border-color .15s ease;
}
.xg-choice-group small { display: block; margin-top: 4px; color: var(--xg-slate); font-size: 12px; font-weight: 400; }
.xg-choice-group input:checked + span { border-color: var(--xg-ink); box-shadow: inset 0 0 0 1px var(--xg-ink); }
.xg-choice-group input:focus-visible + span { outline: 2px solid var(--xg-focus); outline-offset: 2px; }

.xg-config__actions {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--xg-hairline);
}
.xg-config__actions > button:not(.xg-button), .xg-config__actions button[data-back] {
  min-height: 48px; padding: 12px 22px; cursor: pointer;
  color: var(--xg-ink); background: transparent;
  border: 1px solid var(--xg-ink); border-radius: 0;
  font: inherit; font-weight: 700; text-decoration: none;
}
.xg-config__actions button:not([data-back]), .xg-config__actions .xg-button,
.xg-contact-form button[type="submit"] {
  min-height: 48px; padding: 12px 26px; cursor: pointer;
  color: var(--xg-paper); background: var(--xg-ink);
  border: 1px solid var(--xg-ink); border-radius: 0;
  font: inherit; font-weight: 700;
}
.xg-config__actions button:not([data-back]):hover, .xg-config__actions .xg-button:hover,
.xg-contact-form button[type="submit"]:hover { background: var(--xg-steel); border-color: var(--xg-steel); }
.xg-config__actions button[data-back]:hover { color: var(--xg-steel); border-color: var(--xg-steel); }

.xg-check { display: flex !important; gap: 10px; align-items: flex-start; font-weight: 400 !important; }
.xg-check input { width: auto !important; min-height: 0; margin-top: 4px !important; }
.xg-honeypot { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }

/* --- Status + results --------------------------------------------------- */

.xg-tool__status { min-height: 1.4em; margin: 10px 0; color: var(--xg-steel); font-size: 14px; font-weight: 600; }
.xg-tool__status:empty { margin: 0; }
.xg-tool__status.is-error, .xg-tool__status.is-success {
  padding: 13px 16px; border: 1px solid var(--xg-hairline); border-left: 4px solid var(--xg-ink);
  background: var(--xg-mist); color: var(--xg-ink);
}

.xg-draft-banner {
  margin-bottom: 24px; padding: 15px 18px;
  color: var(--xg-ink); background: var(--xg-mist);
  border: 1px solid var(--xg-hairline); border-left: 4px solid var(--xg-ink);
  font-family: var(--xg-mono); font-size: 13px; letter-spacing: .04em; text-transform: uppercase;
}

.xg-result {
  margin-top: 34px; padding: 30px;
  background: var(--xg-mist); border: 1px solid var(--xg-hairline); border-left: 4px solid var(--xg-ink);
}
.xg-result h2, .xg-result h3 { margin-top: 0; }
.xg-result__intro { max-width: 740px; font-size: 18px; color: var(--xg-steel); }

.xg-result__summary {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px;
  margin: 30px 0; overflow: hidden;
  background: var(--xg-hairline); border: 1px solid var(--xg-hairline);
}
.xg-result__summary div { padding: 20px; background: var(--xg-paper); }
.xg-result__summary span, .xg-result__summary strong { display: block; }
.xg-result__summary span {
  color: var(--xg-slate); font-family: var(--xg-mono);
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
}
.xg-result__summary strong { margin-top: 6px; font-size: 20px; line-height: 1.15; }

/* --- Stockists + contact ------------------------------------------------ */

.xg-inline-field { display: flex; gap: 10px; }
.xg-inline-field input { flex: 1; margin: 0; }
.xg-stockist-results { margin-top: 30px; }
.xg-stockist {
  padding: 24px; margin-bottom: 12px;
  background: var(--xg-paper); border: 1px solid var(--xg-hairline);
}
.xg-stockist h3 { margin-top: 0; }
.xg-stockist__distance { color: var(--xg-ink); font-family: var(--xg-mono); font-weight: 700; }
.xg-contact-form { max-width: 850px; }

/* --- Shortcode cards / notices ------------------------------------------ */

.xg-grid { display: grid; gap: 24px; }
.xg-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.xg-card {
  display: flex; flex-direction: column; gap: 10px; padding: 26px;
  background: var(--xg-paper); border: 1px solid var(--xg-hairline);
}
.xg-card img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
.xg-card h2, .xg-card h3 { margin: 0; font-size: 22px; line-height: 1.15; }
.xg-card p { margin: 0; color: var(--xg-slate); font-size: 15px; }
.xg-card__link { align-self: start; color: var(--xg-ink); font-weight: 700; text-decoration-thickness: 1px; text-underline-offset: .2em; }
.xg-card__link:hover { text-decoration-thickness: 2px; }
.xg-notice {
  max-width: 880px; padding: 22px 26px;
  background: var(--xg-mist); border: 1px solid var(--xg-hairline); border-left: 4px solid var(--xg-ink);
}
.xg-notice p { margin: 0; }

/* --- Focus + print ------------------------------------------------------ */

:focus-visible { outline: 2px solid var(--xg-focus); outline-offset: 2px; }

@media (max-width: 860px) {
  .xg-field-grid, .xg-choice-group, .xg-grid--3, .xg-result__summary { grid-template-columns: 1fr; }
  .xg-inline-field { display: block; }
  .xg-inline-field .xg-button { width: 100%; margin-top: 10px; }
}

@media print {
  .xg-utility, .xg-header, .xg-footer, .xg-config, .xg-result .xg-button { display: none !important; }
  .xg-tool { max-width: none; padding: 0; border: 0; }
  .xg-result { display: block !important; }
}

/* Project case-study singles style themselves in the child theme
   stylesheet (xgrid.css): those templates render outside the Elementor
   canvas and on pages where this tools stylesheet does not load. */
