/* ==========================================================================
   UAEEDC base
   Global typography, links, focus and layout helpers.
   Astra sets a lot of this already, so these rules are deliberately narrow
   and target only what needs to change. Do not add component styles here.
   ========================================================================== */

/* --- Typography ---------------------------------------------------------- */

body {
  font-family: var(--u-font-body);
  font-size: var(--u-text-base);
  line-height: var(--u-leading-body);
  color: var(--u-text);
  background-color: var(--u-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3,
.entry-content h1,
.entry-content h2,
.entry-content h3 {
  font-family: var(--u-font-body);
  font-weight: var(--u-weight-semi);
  line-height: var(--u-leading-tight);
  letter-spacing: var(--u-tracking-tight);
  color: var(--u-text);
}

h4, h5, h6 {
  font-family: var(--u-font-body);
  font-weight: var(--u-weight-semi);
  line-height: var(--u-leading-snug);
}

h1 { font-size: var(--u-text-h1); }
h2 { font-size: var(--u-text-h2); }
h3 { font-size: var(--u-text-h3); }

p { max-width: var(--u-container-text); }

/* --- Links --------------------------------------------------------------- */

a {
  color: var(--u-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color var(--u-dur-fast) var(--u-ease);
}

a:hover { color: var(--u-green-700); }

.u-section--alt a { color: var(--u-text-on-alt); }

/* --- Focus ---------------------------------------------------------------
   Visible, high contrast, and never removed. Green, from --u-focus, on
   every page; surfaces in green-900 swap the token for the pale green.
   Astra ships its own a:focus-visible rule (specificity 0,1,1) with a thin
   dotted outline, so the selector list below has to name the elements to
   outrank it.
   ------------------------------------------------------------------------ */

:focus-visible,
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible,
/* Astra's mobile menu toggle has its own thin dotted rule at a higher
   specificity than button:focus-visible; named here so it gets the same
   ring as everything else. */
.ast-button-wrap .menu-toggle:focus-visible,
.ast-menu-toggle:focus-visible {
  outline: 3px solid var(--u-focus);
  outline-offset: 3px;
  border-radius: var(--u-radius-sm);
}

/* Astra's mobile menu toggle measures 42px; 44px is the touch floor. */
.ast-button-wrap .menu-toggle,
.ast-menu-toggle {
  min-width: 44px;
  min-height: 44px;
}

/* Skip link, hidden until focused. */
.u-skip-link {
  position: absolute;
  left: -9999px;
  top: var(--u-space-2);
  z-index: var(--u-z-overlay);
  padding: var(--u-space-3) var(--u-space-4);
  background: var(--u-ink);
  color: var(--u-white);
  border-radius: var(--u-radius-sm);
}

.u-skip-link:focus {
  left: var(--u-space-4);
}

/* --- Layout helpers ------------------------------------------------------
   Prefixed u- so they never collide with Astra or Elementor class names.
   ------------------------------------------------------------------------ */

.u-container {
  width: 100%;
  max-width: var(--u-container);
  margin-inline: auto;
  padding-inline: var(--u-gutter);
}

.u-container--wide { max-width: var(--u-container-wide); }
.u-container--text { max-width: var(--u-container-text); }

.u-section { padding-block: var(--u-section-y); }

.u-section--alt {
  background-color: var(--u-bg-alt);
}

/* Inner page head (setup-site.php's uaeedc_page_head): the watermark inside
   it is absolutely positioned and runs off the right edge. Elementor prints
   frontend.min.css after this file and its .e-con rule sets overflow, so
   the container class is named too to outrank it. */
.u-page-head.e-con {
  position: relative;
  overflow: hidden;
}

.u-section--invert {
  background-color: var(--u-bg-invert);
  color: var(--u-text-invert);
  --u-focus: var(--u-focus-on-dark);
}

.u-section--invert h1,
.u-section--invert h2,
.u-section--invert h3 { color: var(--u-text-invert); }

/* Screen reader only. */
.u-sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --- Motion floor -------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}

/* Elementor's text widget ends with Astra's paragraph margin still inside
   it, which leaves 28px of dead air under every intro and closing line. The
   container gap already spaces widgets, so the last paragraph carries none. */
.elementor-widget-text-editor p:last-child { margin-bottom: 0; }
