/* ==========================================================================
   Sully's — Base / globals
   Box reset, html/body bg, sticky-footer flex, custom-cursor link rules,
   image defaults, reveal-* prep, hover/reduced-motion media queries.

   NOTE: heading and form-element typography is intentionally NOT set here.
   Elementor's heading and form widgets control their own typography via
   widget settings — duplicating that here just creates conflicts.
   ========================================================================== */

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

html, body {
    margin: 0;
    padding: 0;
}

html {
    /* Match overscroll (top + bottom) to the page theme so iOS Safari
       doesn't flash a white bar when the user over-pulls. */
    background-color: var(--overscroll-bg, var(--sullys-navy));
    overscroll-behavior-y: none;
    -webkit-tap-highlight-color: transparent;
    font-size: 16px;
}

body {
    background-color: var(--bg-page);
    color: var(--fg-primary);
    font-family: var(--font-body);
    font-size: var(--type-body);
    line-height: var(--lh-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;

    /* Footer doesn't bounce — flex column with min-height ensures the
       footer sits where it should without a layout shift on first paint. */
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

/* Sticky-footer flow */
main,
.elementor,
#page,
.sullys-main {
    flex: 1 0 auto;
}

footer,
.sullys-footer,
[data-elementor-type="footer"] {
    flex-shrink: 0;
}

/* Links inherit color and hide the native cursor (replaced by custom ring on
   pointer devices). Touch devices restore the pointer in the @media block below. */
a {
    color: inherit;
    text-decoration: none;
    cursor: none;
}

/* Sensible defaults for media — Elementor overrides per widget if needed. */
img, video, picture, svg {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Full-bleed utility — for sections that need to break out of a container. */
.sullys-full-bleed {
    width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
    max-width: none !important;
}

/* Reveal-prep: elements with .reveal-* classes start hidden until
   scroll-reveal JS adds .is-ready (no flash of in-place content). */
.reveal-heading,
.reveal-paragraph,
.reveal-block {
    visibility: hidden;
}
.reveal-heading.is-ready,
.reveal-paragraph.is-ready,
.reveal-block.is-ready {
    visibility: visible;
}

/* Force native smooth-scroll off whenever Lenis is active.
   Lenis adds the `.lenis` class to <html> on init. The CDN's lenis.css
   file should set this rule itself, but we duplicate here as a safety
   net in case the stylesheet fails to load (CDN issue, blocked in
   privacy-mode browsers, etc.) — without it native and JS smooth-scroll
   compete and produce jittery/laggy scroll. */
html.lenis {
    scroll-behavior: auto !important;
}
html.lenis,
html.lenis body {
    height: auto;
}

/* ==========================================================================
   ELEMENTOR EDITOR — neutralise effects that interfere with editing.
   Body gets the `is-elementor-editor` class only when rendering inside
   the editor canvas iframe (functions.php sullys_is_elementor_editor()).
   The heavy JS (Lenis, GSAP, Splitting, custom cursor) is also skipped at
   enqueue time, so these CSS overrides only need to neutralise the few
   pure-CSS rules that would still cause problems while editing.
   ========================================================================== */
body.is-elementor-editor .reveal-heading,
body.is-elementor-editor .reveal-paragraph,
body.is-elementor-editor .reveal-block {
    visibility: visible !important;        /* don't hide content waiting for JS */
}
body.is-elementor-editor a,
body.is-elementor-editor button,
body.is-elementor-editor [data-cursor="expand"],
body.is-elementor-editor .cursor-expand {
    cursor: pointer;                       /* restore native cursor */
}
body.is-elementor-editor .sullys-mobile-toggle,
body.is-elementor-editor .sullys-mobile-close,
body.is-elementor-editor .sullys-theme-switch,
body.is-elementor-editor .sullys-accordion {
    cursor: pointer;
}
body.is-elementor-editor .sullys-cursor {
    display: none !important;              /* JS won't run anyway, but belt-and-braces */
}

/* Touch devices: hide custom cursor, restore native pointer on links. */
@media (hover: none) {
    .sullys-cursor { display: none !important; }
    a, button { cursor: pointer; }
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .sullys-cursor { display: none !important; }
}
