/* Loving Hands Ministries — base layer.
   Keep global overrides conservative: Avada owns layout; the child theme sets
   brand typography, focus, accessible defaults, and utility primitives. */

html {
  scroll-behavior: smooth;
}

body {
  background: var(--lh-bg);
  color: var(--lh-fg);
  font-family: var(--lh-font-sans);
  font-size: var(--lh-text-body);
  line-height: var(--lh-leading-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body,
button,
input,
select,
textarea {
  font-family: var(--lh-font-sans);
}

h1,
h2,
h3,
h4,
h5,
h6,
.lh-h1,
.lh-h2,
.lh-h3,
.lh-h4 {
  color: var(--lh-fg-strong);
  font-family: var(--lh-font-sans);
  letter-spacing: var(--lh-tracking-tight);
  text-wrap: balance;
}

h1,
.lh-h1 {
  font-size: var(--lh-text-h1);
  font-weight: 800;
  line-height: var(--lh-leading-tight);
}

h2,
.lh-h2 {
  font-size: var(--lh-text-h2);
  font-weight: 700;
  line-height: var(--lh-leading-snug);
}

h3,
.lh-h3 {
  font-size: var(--lh-text-h3);
  font-weight: 700;
  line-height: var(--lh-leading-snug);
}

h4,
.lh-h4 {
  font-size: var(--lh-text-h4);
  font-weight: 700;
  line-height: var(--lh-leading-snug);
}

p,
.lh-body {
  color: var(--lh-fg);
  font-size: var(--lh-text-body);
  line-height: var(--lh-leading-normal);
  text-wrap: pretty;
}

.lh-body-lg {
  font-size: var(--lh-text-body-lg);
  line-height: var(--lh-leading-relaxed);
}

.lh-body-sm {
  font-size: var(--lh-text-body-sm);
  line-height: var(--lh-leading-normal);
}

.lh-meta {
  color: var(--lh-fg-muted);
  font-size: var(--lh-text-meta);
  line-height: var(--lh-leading-snug);
}

.lh-reading,
.lh-reading p,
.lh-prose p {
  max-width: 65ch;
}

.lh-prose > * + * {
  margin-top: var(--lh-space-4);
}

.lh-prose ul,
.lh-prose ol {
  margin-block: var(--lh-space-4);
  padding-left: 1.25em;
}

.lh-prose li + li {
  margin-top: var(--lh-space-2);
}

a {
  color: var(--lh-red-700);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.18em;
  transition: color var(--lh-dur-quick) var(--lh-ease-out), box-shadow var(--lh-dur-quick) var(--lh-ease-out);
}

a:hover {
  color: var(--lh-red-900);
}

.lh-skip-link {
  background: var(--lh-white);
  border: 2px solid var(--lh-red-700);
  border-radius: var(--lh-radius-sm);
  box-shadow: var(--lh-shadow-md);
  color: var(--lh-red-700);
  font-size: var(--lh-text-button);
  font-weight: 800;
  left: var(--lh-space-4);
  line-height: 1;
  padding: var(--lh-space-3) var(--lh-space-4);
  position: fixed;
  text-decoration: none;
  top: var(--lh-space-4);
  transform: translateY(calc(-100% - var(--lh-space-6)));
  transition: transform var(--lh-dur-quick) var(--lh-ease-out);
  z-index: 10000;
}

.lh-skip-link:focus,
.lh-skip-link:focus-visible {
  color: var(--lh-red-700);
  outline: 0;
  transform: translateY(0);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible,
.fusion-button:focus-visible,
.fusion-menu a:focus-visible {
  outline: 2px solid var(--lh-red-700);
  outline-offset: 3px;
  box-shadow: var(--lh-focus-ring);
}

::selection {
  background: rgba(237, 28, 36, 0.18);
  color: var(--lh-fg-strong);
}

/* Layout primitives for Avada Custom CSS Class fields. */
.lh-container {
  width: min(100% - (var(--lh-gutter) * 2), var(--lh-width-page));
  margin-inline: auto;
}

.lh-container-wide {
  width: min(100% - (var(--lh-gutter) * 2), var(--lh-width-wide));
  margin-inline: auto;
}

.lh-container-reading {
  width: min(100% - (var(--lh-gutter) * 2), var(--lh-width-reading));
  margin-inline: auto;
}

.lh-section {
  padding-block: clamp(var(--lh-space-8), 7vw, var(--lh-space-10));
}

.lh-section-compact {
  padding-block: clamp(var(--lh-space-7), 5vw, var(--lh-space-8));
}

.lh-section-large {
  padding-block: clamp(var(--lh-space-10), 10vw, var(--lh-space-12));
}

.lh-section-muted {
  background: var(--lh-bg-muted);
}

.lh-section-stone {
  background: var(--lh-bg-stone);
}

.lh-section-inverse {
  background: var(--lh-bg-inverse);
  color: var(--lh-fg-inverse);
}

.lh-section-inverse h1,
.lh-section-inverse h2,
.lh-section-inverse h3,
.lh-section-inverse h4,
.lh-section-inverse .lh-h1,
.lh-section-inverse .lh-h2,
.lh-section-inverse .lh-h3,
.lh-section-inverse .lh-h4 {
  color: var(--lh-fg-inverse);
}

.lh-section-inverse p,
.lh-section-inverse .lh-body,
.lh-section-inverse .lh-meta {
  color: var(--lh-fg-inverse-muted);
}

.lh-grid {
  display: grid;
  gap: clamp(var(--lh-space-5), 3vw, var(--lh-space-7));
}

.lh-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lh-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lh-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.lh-stack > * + * { margin-top: var(--lh-stack-gap, var(--lh-space-4)); }
.lh-stack-tight { --lh-stack-gap: var(--lh-space-2); }
.lh-stack-loose { --lh-stack-gap: var(--lh-space-6); }

.lh-eyebrow {
  color: var(--lh-fg-accent);
  display: block;
  font-size: var(--lh-text-eyebrow);
  font-weight: 800;
  letter-spacing: var(--lh-tracking-eyebrow);
  line-height: var(--lh-leading-snug);
  margin-bottom: var(--lh-space-3);
  text-transform: uppercase;
}

.lh-rule,
.lh-accent-rule {
  background: var(--lh-red-700);
  display: block;
  height: 4px;
  margin-block: var(--lh-space-3) var(--lh-space-5);
  width: 64px;
}

.lh-quote,
blockquote.lh-quote {
  border-left: 3px solid var(--lh-campus-accent, var(--lh-red-700));
  color: var(--lh-fg-strong);
  font-family: var(--lh-font-serif);
  font-size: clamp(1.5rem, 2.6vw, 1.875rem);
  font-style: italic;
  line-height: 1.38;
  margin: var(--lh-space-6) 0;
  padding: var(--lh-space-1) 0 var(--lh-space-1) var(--lh-space-5);
  text-wrap: balance;
}

.lh-sr-only {
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

@media (max-width: 1024px) {
  .lh-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lh-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .lh-grid-2,
  .lh-grid-3,
  .lh-grid-4 {
    grid-template-columns: 1fr;
  }

  .lh-section,
  .lh-section-compact,
  .lh-section-large {
    padding-block: var(--lh-space-8);
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
