/* ==========================================================================
  FTS: base.css
  Purpose: Baseline styles that are safe across themes, BB, ACF, TEC.
  Notes:
  - No site furniture styling here.
  - Keep selectors broad but low-specificity.
  ========================================================================== */

/* --- Reset Lite --- */
*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: var(--base-font-size) !important; /* Anchor rem scale system-wide. */
  -webkit-text-size-adjust: 100%;
  background: var(--color-bg);
}

body {
  margin: 0;
  font-family: var(--font-sans) !important;
  font-size: var(--base-font-size);
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
}

/* BB wrappers inherit background */
.fl-page,
.fl-page-content,
.fl-builder-content {
  background: var(--color-bg);
}

/* Media defaults */
img, video {
  max-width: 100%;
  height: auto; /* maintains aspect ratio when width is constrained */
}
img { display: block; }

/* SVG and canvas: constrain width only. */
svg, canvas {
  max-width: 100%;
}

/* Text safety for long strings */
:where(p, li, td, th, a) {
  overflow-wrap: anywhere;
  word-break: normal;
}

/* Headings baseline */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  line-height: 1.15;
  color: var(--color-heading);
  margin: 0;
}

/* Clean base: remove global p margins */
p {
  margin: 0;
  font-family: var(--font-sans);
}

.no-margin p {
  margin: 0 !important;
}

/* Add paragraph rhythm inside real content zones */
.fl-builder-content :where(.fl-rich-text, .fl-module-content, .entry-content) p,
:where(main, .entry-content) p {
  margin: 0 0 1rem;
}

small { font-size: 0.875em; }

code, kbd, samp, pre { font-family: var(--font-mono); }

/* Links baseline: neutral, a11y owns underline and focus behaviors */
a {
  color: inherit;
  text-decoration-thickness: var(--fts-link-underline-thickness);
  text-underline-offset: var(--fts-link-underline-offset);
  font-weight: inherit;
}
a:hover {
  color: inherit;
}

/* Content link color, scoped to content areas only */
:where(main, .entry-content, .fl-builder-content, .fl-rich-text, .fl-module-content)
a:not(.fl-button):not(.fts-btn):not([class*="fts-btn"]):not([role="button"]):not(.wp-block-button__link):not(.fts-link-card) {
  color: var(--color-link);
  font-weight: var(--weight-semibold);
}

:where(main, .entry-content, .fl-builder-content, .fl-rich-text, .fl-module-content)
a:not(.fl-button):not(.fts-btn):not([class*="fts-btn"]):not([role="button"]):not(.wp-block-button__link):not(.fts-link-card):hover {
  color: var(--sky);
}

/* --------------------------------------------------------------------------
  Content link utilities
  Allows intentional overrides inside content areas.
  Underline animation is owned by a11y.css (loads after this file).
  -------------------------------------------------------------------------- */
.fts-link--inherit a { color: inherit !important; }
.fts-link--inherit a:hover { color: inherit; }

.fts-link--white a { color: var(--white) !important; }
.fts-link--white a:hover { color: var(--sky) !important; }

.fts-link--light a { color: var(--sky) !important; }
.fts-link--light a:hover { color: var(--ocean) !important; }

.fts-link--muted a {
  color: var(--white) !important;
  font-weight: var(--weight-medium) !important;
  opacity: 0.4;
}
.fts-link--muted a:hover {
  color: var(--sky) !important;
  opacity: 0.7;
}

.fts-link--no-underline a {
  background-image: none !important;
  text-decoration: none !important;
}

/* Navigation links: never show underline */
:where(nav, .fl-menu, .menu, .sub-menu) a:hover,
:where(nav, .fl-menu, .menu, .sub-menu) a:focus-visible {
  text-decoration: none !important;
  background-image: none !important;
}

/* Selection */
::selection { background: color-mix(in srgb, var(--sky) 25%, transparent); }

/* Footer anchor */
html, body { height: 100%; }

.fl-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.fl-page-content { flex: 1 0 auto; }

.fl-page-footer-wrap,
.fl-theme-builder-footer {
  margin-top: auto;
}
