/* ==========================================================================
   RealtorCircle V5.0 — site-wide fixes and shared components
   ========================================================================== */

/* --- Mobile: no sideways scrolling ---------------------------------------
   Cause: Bootstrap .row.g-5 (footer, home "Share" section) uses a 3rem gutter,
   so the row's negative margin (-1.5rem) is wider than the container padding
   (.75rem) and pokes 12px past the screen edge on phones and tablets. */
@media (max-width: 1199.98px) {
  .row.g-5,
  .row.gx-5 { --bs-gutter-x: 1.5rem; }
}

/* Safety net: anything still wider than the screen is clipped instead of
   making the whole page scroll sideways. `clip` (not `hidden`) keeps
   position: sticky working. */
html,
body { overflow-x: clip; max-width: 100%; }

/* Long words, URLs and email addresses wrap instead of widening the page. */
.rc-legal-editor,
.rc-contact-card,
.rc-footer-column,
.rc-faq-answer,
.rc-thankyou-note,
.gform_wrapper .gfield_description { overflow-wrap: anywhere; }

img,
svg,
video,
iframe { max-width: 100%; }

/* --- Billing card (Support page, [rc_billing_link]) ---------------------- */
.rc-billing-card { max-width: 560px; margin: 18px auto 0; padding: 16px 18px; border: 1px solid rgba(17, 24, 39, .1); border-radius: 14px; background: #fff; text-align: left; }
.rc-billing-card strong { display: block; font-size: 1rem; color: #111827; }
.rc-billing-card p { margin: 6px 0 12px; font-size: .92rem; line-height: 1.5; color: #4b5563; }
.rc-billing-btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px; border-radius: 999px; background: #111827; color: #fff !important; font-weight: 600; text-decoration: none; }
.rc-billing-btn:hover,
.rc-billing-btn:focus-visible { background: #000; }
.rc-billing-card small { display: block; margin-top: 10px; font-size: .8rem; color: #6b7280; }

/* --- Gravity Forms file-upload rules: visually hidden without overflowing - */
.gform_wrapper .gform_fileupload_rules.screen-reader-text,
.rc-gf-support_wrapper .gform_fileupload_rules { position: absolute !important; width: 1px !important; height: 1px !important; margin: 0 !important; padding: 0 !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; clip-path: inset(50%) !important; white-space: nowrap !important; }

/* ==========================================================================
   V5.3 — Smart sticky header (template-parts/site-header.php, assets/js/site-header.js)
   Stays pinned to the top of the screen, slides away while scrolling down and
   slides back in as soon as the visitor scrolls up. Over the homepage hero it
   starts transparent and turns solid white once the page has scrolled.
   ========================================================================== */
:root { --rc-header-offset: 0px; }
.admin-bar { --rc-header-offset: 32px; }
@media (max-width: 782px) { .admin-bar { --rc-header-offset: 46px; } }
/* WP admin bar scrolls away on small phones, so the header pins to the very top there. */
@media (max-width: 600px) { .admin-bar { --rc-header-offset: 0px; } }

.rc-site-header {
  position: sticky;
  top: var(--rc-header-offset);
  z-index: 1030;
  transition: transform .32s cubic-bezier(.2, .7, .2, 1), background-color .25s ease, box-shadow .25s ease;
  will-change: transform;
}
.rc-site-header--transparent {
  position: fixed;
  top: var(--rc-header-offset);
}
/* Override the V4.12 admin-bar offsets (now handled by --rc-header-offset). */
.admin-bar .rc-site-header--transparent { top: var(--rc-header-offset); }

.rc-site-header.is-hidden { transform: translateY(calc(-100% - var(--rc-header-offset) - 4px)); box-shadow: none; }
.rc-site-header.is-scrolled { box-shadow: 0 6px 24px rgba(17, 24, 39, .08); }
.rc-site-header--light.is-scrolled { border-bottom-color: transparent; }

/* Keyboard users: the header always comes back when something inside it has focus. */
.rc-site-header:has(:focus-visible) { transform: none; }

/* Transparent (homepage) header: solid once scrolled away from the hero top. */
.rc-site-header--transparent.is-scrolled { background: #FFFFFF; }
.rc-site-header--transparent.is-scrolled .rc-site-nav a.rc-site-nav-link:not(.rc-btn) { color: #3A3F4A; }
.rc-site-header--transparent.is-scrolled .rc-site-nav a.rc-site-nav-link:not(.rc-btn):hover,
.rc-site-header--transparent.is-scrolled .rc-site-nav a.rc-site-nav-link:not(.rc-btn):focus-visible { color: #2A5BD7; }
.rc-site-header-logo--solid { display: none; }
.rc-site-header--transparent.is-scrolled .rc-site-header-logo--reverse { display: none; }
.rc-site-header--transparent.is-scrolled .rc-site-header-logo--solid { display: block; }

/* Slightly slimmer bar while pinned below the top of the page. */
.rc-site-header.is-scrolled .rc-site-header-inner { min-height: 72px; transition: min-height .25s ease; }
@media (max-width: 575.98px) {
  .rc-site-header.is-scrolled .rc-site-header-inner { min-height: 60px; }
}

/* In-page links (#faq, #pricing…) land below the header instead of under it. */
html:has(body.rc-has-site-header) { scroll-padding-top: calc(var(--rc-header-offset) + 88px); }

@media (prefers-reduced-motion: reduce) {
  .rc-site-header,
  .rc-site-header .rc-site-header-inner { transition: none; }
}
