/*
 * RE2 Design System — components
 *
 * Written to be applied to ordinary Elementor widgets. Add a class in the
 * widget's Advanced → CSS Classes field and the styling follows; there is no
 * markup of our own involved, so everything stays editable in the builder.
 *
 * Selectors are doubled up where Elementor's own rules would otherwise win —
 * Elementor styles buttons through .elementor-button with fairly high
 * specificity, and losing that fight silently is the main way a design layer
 * like this appears to "not work".
 *
 * Everything hangs off `.re2` on <body>, so the whole layer can be switched off
 * from Settings → RE2 Design System if it ever collides with a plugin.
 */

.re2 ::selection { background: var(--yellow); color: var(--black); }

/* ============================================================
   BUTTONS — neo-brutalist: thick ink border, hard offset shadow
   Apply "btn btn-red" (or btn-white / btn-outline-ink) to an
   Elementor Button widget, or to any link or button.
   ============================================================ */

/*
 * Two shapes have to be covered, because Elementor puts a widget's CSS Classes
 * on the widget WRAPPER div, not on the <a class="elementor-button"> it renders.
 * So `.btn` on a Button widget has to reach one level in — and the wrapper must
 * be neutralised, or the page draws a pill around a pill and Elementor's own
 * global accent colour still shows through as the inner button's background.
 */
.re2 .elementor-widget-button.btn {
  background: none;
  border: 0;
  box-shadow: none;
  padding: 0;
  border-radius: 0;
}

.re2 a.btn,
.re2 button.btn,
.re2 input.btn,
.re2 .elementor-widget-button.btn .elementor-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: var(--sz-sm);
  line-height: 1.2;
  padding: 14px 32px;
  border-radius: var(--r-pill);
  border: 3px solid var(--black);
  cursor: pointer;
  box-shadow: 5px 5px 0 var(--black);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .25s, color .25s;
  text-decoration: none;
  text-shadow: none;
  position: relative;
}

/* The press-down: the button moves toward its shadow rather than lifting. */
.re2 a.btn:hover,
.re2 button.btn:hover,
.re2 .elementor-widget-button.btn .elementor-button:hover,
.re2 .elementor-widget-button.btn .elementor-button:focus {
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 var(--black);
}

.re2 a.btn:active,
.re2 button.btn:active,
.re2 .elementor-widget-button.btn .elementor-button:active {
  transform: translate(5px, 5px);
  box-shadow: 0 0 0 var(--black);
}

/*
 * fill: currentColor is the important line. Elementor sets `fill: #fff` on
 * .elementor-button, and because fill inherits, the FontAwesome arrow SVG picked
 * up white regardless of the button's text colour — a white arrow on a pink
 * button. Tying fill to currentColor makes the icon follow the label, so it
 * flips correctly on hover and on every colour variant without extra rules.
 */
.re2 a.btn svg,
.re2 button.btn svg,
.re2 .elementor-widget-button.btn .elementor-button svg,
.re2 .elementor-widget-button.btn .elementor-button i {
  width: 17px;
  height: 17px;
  flex: none;
  fill: currentColor;
  color: inherit;
  transition: transform .35s var(--ease);
}

/* The icon sits in its own span, which Elementor also colours. */
.re2 .elementor-widget-button.btn .elementor-button-icon,
.re2 .elementor-widget-button.btn .elementor-button-icon svg { color: inherit; fill: currentColor; }

.re2 a.btn:hover svg,
.re2 .elementor-widget-button.btn .elementor-button:hover svg,
.re2 .elementor-widget-button.btn .elementor-button:hover i { transform: translateX(5px); }

.re2 a.btn:focus-visible,
.re2 .elementor-widget-button.btn .elementor-button:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

/* ---- Colour variants ---- */

.re2 a.btn-red, .re2 button.btn-red,
.re2 a.btn-blue, .re2 a.btn-yellow,
.re2 .elementor-widget-button.btn-red .elementor-button,
.re2 .elementor-widget-button.btn-blue .elementor-button,
.re2 .elementor-widget-button.btn-yellow .elementor-button { background: var(--red); color: var(--black); }

.re2 a.btn-white, .re2 button.btn-white, .re2 a.btn-outline,
.re2 .elementor-widget-button.btn-white .elementor-button,
.re2 .elementor-widget-button.btn-outline .elementor-button { background: #fff; color: var(--black); }

.re2 a.btn-outline-ink, .re2 button.btn-outline-ink,
.re2 .elementor-widget-button.btn-outline-ink .elementor-button { background: transparent; color: var(--black); }

/* One hover colour across the whole system keeps interaction predictable. */
.re2 a.btn-red:hover, .re2 button.btn-red:hover,
.re2 a.btn-blue:hover, .re2 a.btn-yellow:hover,
.re2 a.btn-white:hover, .re2 button.btn-white:hover, .re2 a.btn-outline:hover,
.re2 .elementor-widget-button.btn-red .elementor-button:hover,
.re2 .elementor-widget-button.btn-blue .elementor-button:hover,
.re2 .elementor-widget-button.btn-yellow .elementor-button:hover,
.re2 .elementor-widget-button.btn-white .elementor-button:hover,
.re2 .elementor-widget-button.btn-outline .elementor-button:hover { background: var(--teal); color: var(--black); }

.re2 a.btn-outline-ink:hover, .re2 button.btn-outline-ink:hover,
.re2 .elementor-widget-button.btn-outline-ink .elementor-button:hover { background: var(--black); color: #fff; }

/* Elementor's own text colour on the inner label span would otherwise win. */
.re2 .elementor-widget-button.btn .elementor-button-text,
.re2 .elementor-widget-button.btn .elementor-button-content-wrapper { color: inherit; }

.re2 a:focus-visible,
.re2 button:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* ============================================================
   HEADINGS — apply to Elementor Heading / Text Editor widgets
   ============================================================ */

.re2 .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink);
}

.re2 .eyebrow::before {
  content: "";
  width: 26px;
  height: 3px;
  border-radius: 3px;
  background: var(--red);
}

/* Elementor wraps heading text in an inner element, so the marker has to be
   attached there instead when the class lands on the widget itself. */
.re2 .eyebrow.elementor-widget-heading .elementor-heading-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink);
}

.re2 .eyebrow.elementor-widget-heading::before { content: none; }

.re2 .eyebrow.elementor-widget-heading .elementor-heading-title::before {
  content: "";
  width: 26px;
  height: 3px;
  border-radius: 3px;
  background: var(--red);
  flex: none;
}

.re2 .eyebrow.on-dark,
.re2 .eyebrow.on-dark .elementor-heading-title { color: #fff; }

.re2 .eyebrow.on-dark::before,
.re2 .eyebrow.on-dark .elementor-heading-title::before { background: var(--yellow); }

.re2 .eyebrow.green::before,
.re2 .eyebrow.green .elementor-heading-title::before { background: var(--blue); }

.re2 .sec-title,
.re2 .sec-title .elementor-heading-title {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.22;
  color: var(--ink);
  font-size: clamp(30px, 4vw, var(--sz-h2));
}

.re2 .sec-sub,
.re2 .sec-sub p {
  color: var(--grey);
  font-size: var(--sz-body);
  line-height: 1.55;
}

.re2 mark,
.re2 .highlight {
  background: linear-gradient(transparent 55%, var(--yellow) 55%);
  color: inherit;
  padding: 0 4px;
}

/* ============================================================
   FORM FIELDS — Contact Form 7, styled automatically.
   Elementor free cannot style CF7 at all, which is the main
   reason this stylesheet has to exist as a plugin.
   ============================================================ */

.re2 .wpcf7 label {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 13.5px;
  color: var(--ink);
  display: block;
  margin-bottom: 7px;
}

.re2 .wpcf7 label em { color: var(--red); font-style: normal; }

.re2 .wpcf7-form-control:not(.wpcf7-submit):not([type="checkbox"]):not([type="radio"]) {
  width: 100%;
  font-family: var(--font-body);
  font-size: 15.5px;
  /*
   * Inputs and selects must resolve to the same height, and a field's height is
   * padding + border + line-height. Padding and border already match, so the
   * line-height is stated explicitly on both: a select with appearance:none
   * loses the browser's default and would otherwise land a few pixels short of
   * the text input beside it. height:auto stops a theme forcing a third value.
   */
  line-height: 1.5;
  height: auto;
  color: var(--ink);
  background: #fff;
  border: 2.5px solid var(--black);
  border-radius: 12px;
  padding: 14px 18px;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .25s;
  -webkit-appearance: none;
  box-shadow: 4px 4px 0 var(--black);
}

.re2 .wpcf7-form-control:not(.wpcf7-submit):hover { background: #fffdf2; }

.re2 .wpcf7-form-control:not(.wpcf7-submit):focus {
  outline: none;
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--blue);
  border-color: var(--blue);
}

.re2 textarea.wpcf7-form-control { min-height: 130px; resize: vertical; }

/*
 * The rule above uses the `background` shorthand, which resets background-image
 * to none — so the chevron only survives if this selector is at least as
 * specific. That rule spends five compound selectors on its :not() chain, hence
 * the matching chain here plus :not([multiple]) to tip it over.
 *
 * The colour is forced because a select is one of the few controls a parent
 * theme still restyles from its own stylesheet; if it wins, the closed field
 * shows an unreadable label and the form looks broken rather than empty.
 */
.re2 select.wpcf7-form-control:not(.wpcf7-submit):not([type="checkbox"]):not([type="radio"]):not([multiple]) {
  cursor: pointer;
  color: var(--ink) !important;
  line-height: 1.5;
  height: auto;
  background-color: #fff;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'><path d='M1 1l6 6 6-6' fill='none' stroke='%23383838' stroke-width='2' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 16px center;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding: 14px 44px 14px 18px;
  text-indent: 0;
  /* A narrow column would otherwise clip the option mid-word. */
  text-overflow: ellipsis;
}

.re2 select.wpcf7-form-control option { color: var(--ink) !important; background: #fff; }

/*
 * The submit button gets the full brutalist treatment without needing a class,
 * since there is only ever one and it should always look like a primary action.
 *
 * Every interaction state is listed explicitly. Astra styles :focus, :active
 * and :disabled on buttons separately from the base, with its own global blue -
 * so the moment the button was clicked it kept focus and reverted to a plain
 * blue pill. Matching the states here keeps the button looking the same before,
 * during and after a submission.
 */
.re2 .wpcf7-submit,
.re2 .wpcf7-submit:focus,
.re2 .wpcf7-submit:focus-visible,
.re2 .wpcf7-submit:active,
.re2 .wpcf7-submit:disabled,
.re2 .wpcf7-submit[disabled] {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: var(--sz-sm);
  padding: 14px 32px;
  border-radius: var(--r-pill);
  border: 3px solid var(--black) !important;
  background: var(--red) !important;
  color: var(--black) !important;
  cursor: pointer;
  box-shadow: 5px 5px 0 var(--black) !important;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .25s, opacity .25s;
}

.re2 .wpcf7-submit:hover {
  background: var(--teal) !important;
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 var(--black) !important;
}

/* Keyboard focus still needs to be visible - it just should not repaint the
   button. */
.re2 .wpcf7-submit:focus-visible {
  outline: 3px solid var(--blue-dark);
  outline-offset: 3px;
}

/* CF7 disables the button while the request is in flight; it presses in and
   dims rather than changing colour, so the state reads as "working". */
.re2 .wpcf7-submit:disabled,
.re2 .wpcf7-submit[disabled] {
  opacity: .65;
  cursor: progress;
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 var(--black) !important;
}

/* Two-column form layout — add class "form-grid" to a <div> in the CF7 template. */
.re2 .wpcf7 .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.re2 .wpcf7 .form-grid .full { grid-column: 1 / -1; }

/*
 * CF7 wraps every field in its own <p>, so each row carried a paragraph margin
 * on top of the grid gap and the rows drifted far apart. The gap alone should
 * set the rhythm; the submit paragraph keeps a deliberate margin of its own so
 * the button is not glued to the last field.
 */
.re2 .wpcf7 .form-grid > p { margin: 0; }
.re2 .wpcf7 .form-grid + p { margin: 20px 0 0; }

@media (max-width: 560px) {
  .re2 .wpcf7 .form-grid { grid-template-columns: 1fr; }
}

.re2 .wpcf7-response-output {
  margin-top: 18px !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding: 14px 20px !important;
  border-radius: 12px;
  font-size: 14.5px;
  font-weight: 600;
  border-width: 2px !important;
}

.re2 .wpcf7-not-valid-tip { color: #a4141b; font-size: 13px; margin-top: 6px; }

/* ============================================================
   SCROLL REVEALS — add "reveal" (or reveal-left / reveal-right /
   reveal-zoom) to any Elementor container or widget. Add d1–d5
   to stagger siblings.
   ============================================================ */

.re2 .reveal { opacity: 0; transform: translateY(30px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.re2 .reveal-left { opacity: 0; transform: translateX(-40px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.re2 .reveal-right { opacity: 0; transform: translateX(40px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.re2 .reveal-zoom { opacity: 0; transform: scale(.88); transition: opacity .7s var(--ease), transform .7s var(--ease); }

.re2 .reveal.is-visible,
.re2 .reveal-left.is-visible,
.re2 .reveal-right.is-visible,
.re2 .reveal-zoom.is-visible { opacity: 1; transform: none; }

.re2 .d1 { transition-delay: .1s; }
.re2 .d2 { transition-delay: .2s; }
.re2 .d3 { transition-delay: .3s; }
.re2 .d4 { transition-delay: .4s; }
.re2 .d5 { transition-delay: .5s; }

/*
 * Inside the Elementor editor the observer never runs, so reveal elements would
 * sit invisible and read as a broken layout to whoever is building the page.
 */
.elementor-editor-active .reveal,
.elementor-editor-active .reveal-left,
.elementor-editor-active .reveal-right,
.elementor-editor-active .reveal-zoom {
  opacity: 1 !important;
  transform: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .re2 .reveal,
  .re2 .reveal-left,
  .re2 .reveal-right,
  .re2 .reveal-zoom {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ============================================================
   SMALL UTILITIES
   ============================================================ */

.re2 .surface-tint { background: var(--surface); }
.re2 .ink-panel { background: var(--black); color: #fff; }
.re2 .ink-panel h1, .re2 .ink-panel h2, .re2 .ink-panel h3 { color: #fff; }

/*
 * Hard-shadow frame for any container that should read as a brutalist card.
 * box-sizing is stated explicitly rather than assumed: Elementor sets it
 * globally, but a card carrying a 3px border plus padding overflows its grid
 * track without it, and the symptom — cards touching where a gap was set —
 * looks like a spacing bug rather than a box-model one.
 */
.re2 .brutal-card {
  box-sizing: border-box;
  background: #fff;
  border: 3px solid var(--black);
  border-radius: 14px;
  box-shadow: 8px 8px 0 var(--black);
}

.re2 .brutal-card.is-interactive {
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}

.re2 .brutal-card.is-interactive:hover {
  transform: translate(4px, 4px);
  box-shadow: 4px 4px 0 var(--black);
}
